]> err.no Git - linux-2.6/commitdiff
[NETFILTER]: Restore {ipt,ip6t,ebt}_LOG compatibility
authorPatrick McHardy <kaber@trash.net>
Mon, 27 Feb 2006 21:04:17 +0000 (13:04 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Feb 2006 21:04:17 +0000 (13:04 -0800)
The nfnetlink_log infrastructure changes broke compatiblity of the LOG
targets. They currently use whatever log backend was registered first,
which means that if ipt_ULOG was loaded first, no messages will be printed
to the ring buffer anymore.

Restore compatiblity by using the old log functions by default and only use
the nf_log backend if the user explicitly said so.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netfilter_bridge/ebt_log.h
include/linux/netfilter_ipv4/ipt_LOG.h
include/linux/netfilter_ipv6/ip6t_LOG.h
net/bridge/netfilter/ebt_log.c
net/ipv4/netfilter/ipt_LOG.c
net/ipv6/netfilter/ip6t_LOG.c

index 358fbc84fb59c52b391aaa4b831a297f6a4db0d3..96e231ae75548a3188b77b5708567cb99c75e0e4 100644 (file)
@@ -3,6 +3,7 @@
 
 #define EBT_LOG_IP 0x01 /* if the frame is made by ip, log the ip information */
 #define EBT_LOG_ARP 0x02
+#define EBT_LOG_NFLOG 0x04
 #define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP)
 #define EBT_LOG_PREFIX_SIZE 30
 #define EBT_LOG_WATCHER "log"
index 22d16177319b9d46a335d11ede61f86c9fb28b8d..892f9a33fea88eff56fcb94ae9247705a3a44814 100644 (file)
@@ -6,7 +6,8 @@
 #define IPT_LOG_TCPOPT         0x02    /* Log TCP options */
 #define IPT_LOG_IPOPT          0x04    /* Log IP options */
 #define IPT_LOG_UID            0x08    /* Log UID owning local socket */
-#define IPT_LOG_MASK           0x0f
+#define IPT_LOG_NFLOG          0x10    /* Log using nf_log backend */
+#define IPT_LOG_MASK           0x1f
 
 struct ipt_log_info {
        unsigned char level;
index 9008ff5c40aec70e209f8f9efd036e34db1621ab..060c1a1c6c603ab19231b34d0e7325912d8f4b77 100644 (file)
@@ -6,7 +6,8 @@
 #define IP6T_LOG_TCPOPT                0x02    /* Log TCP options */
 #define IP6T_LOG_IPOPT         0x04    /* Log IP options */
 #define IP6T_LOG_UID           0x08    /* Log UID owning local socket */
-#define IP6T_LOG_MASK          0x0f
+#define IP6T_LOG_NFLOG         0x10    /* Log using nf_log backend */
+#define IP6T_LOG_MASK          0x1f
 
 struct ip6t_log_info {
        unsigned char level;
index 0128fbbe23281241d2929ab9ffd6eb74d71d67d9..288ff1d4ccc47fc453ba1cb6b605581da8722358 100644 (file)
@@ -166,7 +166,12 @@ static void ebt_log(const struct sk_buff *skb, unsigned int hooknr,
        li.u.log.level = info->loglevel;
        li.u.log.logflags = info->bitmask;
 
-       nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, info->prefix);
+       if (info->bitmask & EBT_LOG_NFLOG)
+               nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li,
+                             info->prefix);
+       else
+               ebt_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li,
+                              info->prefix);
 }
 
 static struct ebt_watcher log =
index 6606ddb66a29e6ea0044c24ce596bb9767aae424..cc27545ff97f67b3d60dbea1b3f32bce4f8d3001 100644 (file)
@@ -425,7 +425,12 @@ ipt_log_target(struct sk_buff **pskb,
        li.u.log.level = loginfo->level;
        li.u.log.logflags = loginfo->logflags;
 
-       nf_log_packet(PF_INET, hooknum, *pskb, in, out, &li, loginfo->prefix);
+       if (loginfo->logflags & IPT_LOG_NFLOG)
+               nf_log_packet(PF_INET, hooknum, *pskb, in, out, &li,
+                             loginfo->prefix);
+       else
+               ipt_log_packet(PF_INET, hooknum, *pskb, in, out, &li,
+                              loginfo->prefix);
 
        return IPT_CONTINUE;
 }
index 77c725832decdbfc28b1108f9912cae8b09965dd..6b930efa9fb9965bc78bcb64009ffb81a51e8b0d 100644 (file)
@@ -436,7 +436,12 @@ ip6t_log_target(struct sk_buff **pskb,
        li.u.log.level = loginfo->level;
        li.u.log.logflags = loginfo->logflags;
 
-       nf_log_packet(PF_INET6, hooknum, *pskb, in, out, &li, loginfo->prefix);
+       if (loginfo->logflags & IP6T_LOG_NFLOG)
+               nf_log_packet(PF_INET6, hooknum, *pskb, in, out, &li,
+                             loginfo->prefix);
+       else
+               ip6t_log_packet(PF_INET6, hooknum, *pskb, in, out, &li,
+                               loginfo->prefix);
 
        return IP6T_CONTINUE;
 }