]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/netfilter/ipt_LOG.c
[NETFILTER]: nf_nat: add SNMP NAT helper port
[linux-2.6-omap-h63xx.git] / net / ipv4 / netfilter / ipt_LOG.c
index 750d3221b280e897f5980fdc4c8674354d682a60..c96de16fefae67ed9a634fd2ad8c2f56edf65289 100644 (file)
@@ -171,11 +171,15 @@ static void dump_packet(const struct nf_loginfo *info,
                }
                break;
        }
-       case IPPROTO_UDP: {
+       case IPPROTO_UDP:
+       case IPPROTO_UDPLITE: {
                struct udphdr _udph, *uh;
 
-               /* Max length: 10 "PROTO=UDP " */
-               printk("PROTO=UDP ");
+               if (ih->protocol == IPPROTO_UDP)
+                       /* Max length: 10 "PROTO=UDP "     */
+                       printk("PROTO=UDP " );
+               else    /* Max length: 14 "PROTO=UDPLITE " */
+                       printk("PROTO=UDPLITE ");
 
                if (ntohs(ih->frag_off) & IP_OFFSET)
                        break;
@@ -341,6 +345,7 @@ static void dump_packet(const struct nf_loginfo *info,
        /* IP:      40+46+6+11+127 = 230 */
        /* TCP:     10+max(25,20+30+13+9+32+11+127) = 252 */
        /* UDP:     10+max(25,20) = 35 */
+       /* UDPLITE: 14+max(25,20) = 39 */
        /* ICMP:    11+max(25, 18+25+max(19,14,24+3+n+10,3+n+10)) = 91+n */
        /* ESP:     10+max(25)+15 = 50 */
        /* AH:      9+max(25)+15 = 49 */
@@ -416,8 +421,7 @@ ipt_log_target(struct sk_buff **pskb,
               const struct net_device *out,
               unsigned int hooknum,
               const struct xt_target *target,
-              const void *targinfo,
-              void *userinfo)
+              const void *targinfo)
 {
        const struct ipt_log_info *loginfo = targinfo;
        struct nf_loginfo li;
@@ -426,13 +430,8 @@ ipt_log_target(struct sk_buff **pskb,
        li.u.log.level = loginfo->level;
        li.u.log.logflags = loginfo->logflags;
 
-       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);
-
+       ipt_log_packet(PF_INET, hooknum, *pskb, in, out, &li,
+                      loginfo->prefix);
        return IPT_CONTINUE;
 }
 
@@ -440,7 +439,6 @@ static int ipt_log_checkentry(const char *tablename,
                              const void *e,
                              const struct xt_target *target,
                              void *targinfo,
-                             unsigned int targinfosize,
                              unsigned int hook_mask)
 {
        const struct ipt_log_info *loginfo = targinfo;
@@ -471,7 +469,7 @@ static struct nf_logger ipt_log_logger ={
        .me             = THIS_MODULE,
 };
 
-static int __init init(void)
+static int __init ipt_log_init(void)
 {
        if (ipt_register_target(&ipt_log_reg))
                return -EINVAL;
@@ -485,11 +483,11 @@ static int __init init(void)
        return 0;
 }
 
-static void __exit fini(void)
+static void __exit ipt_log_fini(void)
 {
        nf_log_unregister_logger(&ipt_log_logger);
        ipt_unregister_target(&ipt_log_reg);
 }
 
-module_init(init);
-module_exit(fini);
+module_init(ipt_log_init);
+module_exit(ipt_log_fini);