]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/netfilter/ipt_LOG.c
Merge branch 'linus' into test
[linux-2.6-omap-h63xx.git] / net / ipv4 / netfilter / ipt_LOG.c
index b38d7850f506999f84691977ea4e6379a92cd34d..fc6ce04a3e35a809049a340edbc3e10470e5f28e 100644 (file)
@@ -76,7 +76,8 @@ static void dump_packet(const struct nf_loginfo *info,
 
        if ((logflags & IPT_LOG_IPOPT)
            && ih->ihl * 4 > sizeof(struct iphdr)) {
-               unsigned char _opt[4 * 15 - sizeof(struct iphdr)], *op;
+               const unsigned char *op;
+               unsigned char _opt[4 * 15 - sizeof(struct iphdr)];
                unsigned int i, optsize;
 
                optsize = ih->ihl * 4 - sizeof(struct iphdr);
@@ -338,12 +339,16 @@ static void dump_packet(const struct nf_loginfo *info,
        if ((logflags & IPT_LOG_UID) && !iphoff && skb->sk) {
                read_lock_bh(&skb->sk->sk_callback_lock);
                if (skb->sk->sk_socket && skb->sk->sk_socket->file)
-                       printk("UID=%u GID=%u",
+                       printk("UID=%u GID=%u ",
                                skb->sk->sk_socket->file->f_uid,
                                skb->sk->sk_socket->file->f_gid);
                read_unlock_bh(&skb->sk->sk_callback_lock);
        }
 
+       /* Max length: 16 "MARK=0xFFFFFFFF " */
+       if (!iphoff && skb->mark)
+               printk("MARK=0x%x ", skb->mark);
+
        /* Proto    Max log string length */
        /* IP:      40+46+6+11+127 = 230 */
        /* TCP:     10+max(25,20+30+13+9+32+11+127) = 252 */
@@ -370,7 +375,7 @@ static struct nf_loginfo default_loginfo = {
 };
 
 static void
-ipt_log_packet(unsigned int pf,
+ipt_log_packet(u_int8_t pf,
               unsigned int hooknum,
               const struct sk_buff *skb,
               const struct net_device *in,
@@ -421,28 +426,23 @@ ipt_log_packet(unsigned int pf,
 }
 
 static unsigned int
-log_tg(struct sk_buff *skb, const struct net_device *in,
-       const struct net_device *out, unsigned int hooknum,
-       const struct xt_target *target, const void *targinfo)
+log_tg(struct sk_buff *skb, const struct xt_target_param *par)
 {
-       const struct ipt_log_info *loginfo = targinfo;
+       const struct ipt_log_info *loginfo = par->targinfo;
        struct nf_loginfo li;
 
        li.type = NF_LOG_TYPE_LOG;
        li.u.log.level = loginfo->level;
        li.u.log.logflags = loginfo->logflags;
 
-       ipt_log_packet(PF_INET, hooknum, skb, in, out, &li,
+       ipt_log_packet(NFPROTO_IPV4, par->hooknum, skb, par->in, par->out, &li,
                       loginfo->prefix);
        return XT_CONTINUE;
 }
 
-static bool
-log_tg_check(const char *tablename, const void *e,
-             const struct xt_target *target, void *targinfo,
-             unsigned int hook_mask)
+static bool log_tg_check(const struct xt_tgchk_param *par)
 {
-       const struct ipt_log_info *loginfo = targinfo;
+       const struct ipt_log_info *loginfo = par->targinfo;
 
        if (loginfo->level >= 8) {
                pr_debug("LOG: level %u >= 8\n", loginfo->level);
@@ -458,7 +458,7 @@ log_tg_check(const char *tablename, const void *e,
 
 static struct xt_target log_tg_reg __read_mostly = {
        .name           = "LOG",
-       .family         = AF_INET,
+       .family         = NFPROTO_IPV4,
        .target         = log_tg,
        .targetsize     = sizeof(struct ipt_log_info),
        .checkentry     = log_tg_check,
@@ -478,7 +478,7 @@ static int __init log_tg_init(void)
        ret = xt_register_target(&log_tg_reg);
        if (ret < 0)
                return ret;
-       nf_log_register(PF_INET, &ipt_log_logger);
+       nf_log_register(NFPROTO_IPV4, &ipt_log_logger);
        return 0;
 }