netfilter: nf_log: get rid of XT_LOG_* macros
authorLiping Zhang <liping.zhang@spreadtrum.com>
Sun, 25 Sep 2016 08:47:05 +0000 (16:47 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 25 Sep 2016 21:16:45 +0000 (23:16 +0200)
nf_log is used by both nftables and iptables, so use XT_LOG_XXX macros
here is not appropriate. Replace them with NF_LOG_XXX.

Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/ipv4/netfilter/nf_log_ipv4.c
net/ipv6/netfilter/nf_log_ipv6.c
net/netfilter/nf_log_common.c

index 5b571e1b5f1502ccae773f8430d7034280a70923..856648966f4c209b5d01b608afb1b25a069b8b54 100644 (file)
@@ -76,7 +76,7 @@ static void dump_ipv4_packet(struct nf_log_buf *m,
        if (ntohs(ih->frag_off) & IP_OFFSET)
                nf_log_buf_add(m, "FRAG:%u ", ntohs(ih->frag_off) & IP_OFFSET);
 
-       if ((logflags & XT_LOG_IPOPT) &&
+       if ((logflags & NF_LOG_IPOPT) &&
            ih->ihl * 4 > sizeof(struct iphdr)) {
                const unsigned char *op;
                unsigned char _opt[4 * 15 - sizeof(struct iphdr)];
@@ -250,7 +250,7 @@ static void dump_ipv4_packet(struct nf_log_buf *m,
        }
 
        /* Max length: 15 "UID=4294967295 " */
-       if ((logflags & XT_LOG_UID) && !iphoff)
+       if ((logflags & NF_LOG_UID) && !iphoff)
                nf_log_dump_sk_uid_gid(m, skb->sk);
 
        /* Max length: 16 "MARK=0xFFFFFFFF " */
@@ -282,7 +282,7 @@ static void dump_ipv4_mac_header(struct nf_log_buf *m,
        if (info->type == NF_LOG_TYPE_LOG)
                logflags = info->u.log.logflags;
 
-       if (!(logflags & XT_LOG_MACDECODE))
+       if (!(logflags & NF_LOG_MACDECODE))
                goto fallback;
 
        switch (dev->type) {
index f6aee2895fee0328efe959fe3c4a60b84ef5bd8b..57d86066a13bc567d0526da14b13173657acac9c 100644 (file)
@@ -84,7 +84,7 @@ static void dump_ipv6_packet(struct nf_log_buf *m,
                }
 
                /* Max length: 48 "OPT (...) " */
-               if (logflags & XT_LOG_IPOPT)
+               if (logflags & NF_LOG_IPOPT)
                        nf_log_buf_add(m, "OPT ( ");
 
                switch (currenthdr) {
@@ -121,7 +121,7 @@ static void dump_ipv6_packet(struct nf_log_buf *m,
                case IPPROTO_ROUTING:
                case IPPROTO_HOPOPTS:
                        if (fragment) {
-                               if (logflags & XT_LOG_IPOPT)
+                               if (logflags & NF_LOG_IPOPT)
                                        nf_log_buf_add(m, ")");
                                return;
                        }
@@ -129,7 +129,7 @@ static void dump_ipv6_packet(struct nf_log_buf *m,
                        break;
                /* Max Length */
                case IPPROTO_AH:
-                       if (logflags & XT_LOG_IPOPT) {
+                       if (logflags & NF_LOG_IPOPT) {
                                struct ip_auth_hdr _ahdr;
                                const struct ip_auth_hdr *ah;
 
@@ -161,7 +161,7 @@ static void dump_ipv6_packet(struct nf_log_buf *m,
                        hdrlen = (hp->hdrlen+2)<<2;
                        break;
                case IPPROTO_ESP:
-                       if (logflags & XT_LOG_IPOPT) {
+                       if (logflags & NF_LOG_IPOPT) {
                                struct ip_esp_hdr _esph;
                                const struct ip_esp_hdr *eh;
 
@@ -194,7 +194,7 @@ static void dump_ipv6_packet(struct nf_log_buf *m,
                        nf_log_buf_add(m, "Unknown Ext Hdr %u", currenthdr);
                        return;
                }
-               if (logflags & XT_LOG_IPOPT)
+               if (logflags & NF_LOG_IPOPT)
                        nf_log_buf_add(m, ") ");
 
                currenthdr = hp->nexthdr;
@@ -277,7 +277,7 @@ static void dump_ipv6_packet(struct nf_log_buf *m,
        }
 
        /* Max length: 15 "UID=4294967295 " */
-       if ((logflags & XT_LOG_UID) && recurse)
+       if ((logflags & NF_LOG_UID) && recurse)
                nf_log_dump_sk_uid_gid(m, skb->sk);
 
        /* Max length: 16 "MARK=0xFFFFFFFF " */
@@ -295,7 +295,7 @@ static void dump_ipv6_mac_header(struct nf_log_buf *m,
        if (info->type == NF_LOG_TYPE_LOG)
                logflags = info->u.log.logflags;
 
-       if (!(logflags & XT_LOG_MACDECODE))
+       if (!(logflags & NF_LOG_MACDECODE))
                goto fallback;
 
        switch (dev->type) {
index a5aa5967b8e17b894a798dbf29d07bf12063fc16..119fe1cb1ea917918d586e96c1e034d82e0d151a 100644 (file)
@@ -77,7 +77,7 @@ int nf_log_dump_tcp_header(struct nf_log_buf *m, const struct sk_buff *skb,
        nf_log_buf_add(m, "SPT=%u DPT=%u ",
                       ntohs(th->source), ntohs(th->dest));
        /* Max length: 30 "SEQ=4294967295 ACK=4294967295 " */
-       if (logflags & XT_LOG_TCPSEQ) {
+       if (logflags & NF_LOG_TCPSEQ) {
                nf_log_buf_add(m, "SEQ=%u ACK=%u ",
                               ntohl(th->seq), ntohl(th->ack_seq));
        }
@@ -107,7 +107,7 @@ int nf_log_dump_tcp_header(struct nf_log_buf *m, const struct sk_buff *skb,
        /* Max length: 11 "URGP=65535 " */
        nf_log_buf_add(m, "URGP=%u ", ntohs(th->urg_ptr));
 
-       if ((logflags & XT_LOG_TCPOPT) && th->doff*4 > sizeof(struct tcphdr)) {
+       if ((logflags & NF_LOG_TCPOPT) && th->doff*4 > sizeof(struct tcphdr)) {
                u_int8_t _opt[60 - sizeof(struct tcphdr)];
                const u_int8_t *op;
                unsigned int i;