]> err.no Git - linux-2.6/blobdiff - net/bridge/netfilter/ebt_log.c
[EBTABLES]: translate_table(): switch direct uses of repl->hook_info to newinfo
[linux-2.6] / net / bridge / netfilter / ebt_log.c
index 0128fbbe23281241d2929ab9ffd6eb74d71d67d9..a184f879f25396ea0b1dd079fd8a4d1de641a01d 100644 (file)
@@ -38,8 +38,8 @@ static int ebt_log_check(const char *tablename, unsigned int hookmask,
 
 struct tcpudphdr
 {
-       uint16_t src;
-       uint16_t dst;
+       __be16 src;
+       __be16 dst;
 };
 
 struct arppayload
@@ -130,7 +130,7 @@ ebt_log_packet(unsigned int pf, unsigned int hooknum,
                 * then log the ARP payload */
                if (ah->ar_hrd == htons(1) &&
                    ah->ar_hln == ETH_ALEN &&
-                   ah->ar_pln == sizeof(uint32_t)) {
+                   ah->ar_pln == sizeof(__be32)) {
                        struct arppayload _arpp, *ap;
 
                        ap = skb_header_pointer(skb, sizeof(_arph),
@@ -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,
+                             "%s", info->prefix);
+       else
+               ebt_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li,
+                              info->prefix);
 }
 
 static struct ebt_watcher log =
@@ -183,7 +188,7 @@ static struct nf_logger ebt_log_logger = {
        .me             = THIS_MODULE,
 };
 
-static int __init init(void)
+static int __init ebt_log_init(void)
 {
        int ret;
 
@@ -200,12 +205,12 @@ static int __init init(void)
        return 0;
 }
 
-static void __exit fini(void)
+static void __exit ebt_log_fini(void)
 {
        nf_log_unregister_logger(&ebt_log_logger);
        ebt_unregister_watcher(&log);
 }
 
-module_init(init);
-module_exit(fini);
+module_init(ebt_log_init);
+module_exit(ebt_log_fini);
 MODULE_LICENSE("GPL");