summaryrefslogtreecommitdiffstats
path: root/net/netfilter/nft_log.c
diff options
context:
space:
mode:
authorPatrick McHardy2014-02-06 10:17:41 +0100
committerPablo Neira Ayuso2014-02-06 11:41:38 +0100
commitb8ecbee67c732ef9fc47fcf50aed6b7bb6231d98 (patch)
treedac36b02c3026506d5fe2199ebbd0cc6e10ee61b /net/netfilter/nft_log.c
parentnetfilter: nf_tables: add reject module for NFPROTO_INET (diff)
downloadkernel-qcow2-linux-b8ecbee67c732ef9fc47fcf50aed6b7bb6231d98.tar.gz
kernel-qcow2-linux-b8ecbee67c732ef9fc47fcf50aed6b7bb6231d98.tar.xz
kernel-qcow2-linux-b8ecbee67c732ef9fc47fcf50aed6b7bb6231d98.zip
netfilter: nf_tables: fix log/queue expressions for NFPROTO_INET
The log and queue expressions both store the family during ->init() and use it to deliver packets. This is wrong when used in NFPROTO_INET since they should both deliver to the actual AF of the packet, not the dummy NFPROTO_INET. Use the family from the hook ops to fix this. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nft_log.c')
-rw-r--r--net/netfilter/nft_log.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/netfilter/nft_log.c b/net/netfilter/nft_log.c
index 5af790123ad8..26c5154e05f3 100644
--- a/net/netfilter/nft_log.c
+++ b/net/netfilter/nft_log.c
@@ -23,7 +23,6 @@ static const char *nft_log_null_prefix = "";
struct nft_log {
struct nf_loginfo loginfo;
char *prefix;
- int family;
};
static void nft_log_eval(const struct nft_expr *expr,
@@ -33,7 +32,7 @@ static void nft_log_eval(const struct nft_expr *expr,
const struct nft_log *priv = nft_expr_priv(expr);
struct net *net = dev_net(pkt->in ? pkt->in : pkt->out);
- nf_log_packet(net, priv->family, pkt->ops->hooknum, pkt->skb, pkt->in,
+ nf_log_packet(net, pkt->ops->pf, pkt->ops->hooknum, pkt->skb, pkt->in,
pkt->out, &priv->loginfo, "%s", priv->prefix);
}
@@ -52,8 +51,6 @@ static int nft_log_init(const struct nft_ctx *ctx,
struct nf_loginfo *li = &priv->loginfo;
const struct nlattr *nla;
- priv->family = ctx->afi->family;
-
nla = tb[NFTA_LOG_PREFIX];
if (nla != NULL) {
priv->prefix = kmalloc(nla_len(nla) + 1, GFP_KERNEL);