Commit 5f7340eff8f68f41b7e5c7ad47ec4cd1ea1afb40

Authored by Eric Leblond
Committed by Patrick McHardy
1 parent d2ad3ca88d

netfilter: xt_NFLOG: don't call nf_log_packet in NFLOG module.

This patch modifies xt_NFLOG to suppress the call to nf_log_packet()
function. The call of this wrapper in xt_NFLOG was causing NFLOG to
use the first initialized module. Thus, if ipt_ULOG is loaded before
nfnetlink_log all NFLOG rules are treated as plain LOG rules.

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Patrick McHardy <kaber@trash.net>

Showing 3 changed files with 19 additions and 3 deletions Side-by-side Diff

include/net/netfilter/nfnetlink_log.h
  1 +#ifndef _KER_NFNETLINK_LOG_H
  2 +#define _KER_NFNETLINK_LOG_H
  3 +
  4 +void
  5 +nfulnl_log_packet(unsigned int pf,
  6 + unsigned int hooknum,
  7 + const struct sk_buff *skb,
  8 + const struct net_device *in,
  9 + const struct net_device *out,
  10 + const struct nf_loginfo *li_user,
  11 + const char *prefix);
  12 +
  13 +#endif /* _KER_NFNETLINK_LOG_H */
net/netfilter/nfnetlink_log.c
... ... @@ -533,7 +533,7 @@
533 533 };
534 534  
535 535 /* log handler for internal netfilter logging api */
536   -static void
  536 +void
537 537 nfulnl_log_packet(u_int8_t pf,
538 538 unsigned int hooknum,
539 539 const struct sk_buff *skb,
... ... @@ -648,6 +648,7 @@
648 648 /* FIXME: statistics */
649 649 goto unlock_and_release;
650 650 }
  651 +EXPORT_SYMBOL_GPL(nfulnl_log_packet);
651 652  
652 653 static int
653 654 nfulnl_rcv_nl_event(struct notifier_block *this,
net/netfilter/xt_NFLOG.c
... ... @@ -13,6 +13,7 @@
13 13 #include <linux/netfilter/x_tables.h>
14 14 #include <linux/netfilter/xt_NFLOG.h>
15 15 #include <net/netfilter/nf_log.h>
  16 +#include <net/netfilter/nfnetlink_log.h>
16 17  
17 18 MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>");
18 19 MODULE_DESCRIPTION("Xtables: packet logging to netlink using NFLOG");
... ... @@ -31,8 +32,8 @@
31 32 li.u.ulog.group = info->group;
32 33 li.u.ulog.qthreshold = info->threshold;
33 34  
34   - nf_log_packet(par->family, par->hooknum, skb, par->in,
35   - par->out, &li, "%s", info->prefix);
  35 + nfulnl_log_packet(par->family, par->hooknum, skb, par->in,
  36 + par->out, &li, info->prefix);
36 37 return XT_CONTINUE;
37 38 }
38 39