]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
netfilter: log_arp: Use ARPHRD_ETHER instead of literal '1'
authorGao Feng <fgao@ikuai8.com>
Sun, 28 Aug 2016 13:41:22 +0000 (21:41 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 30 Aug 2016 09:51:08 +0000 (11:51 +0200)
There is one macro ARPHRD_ETHER which defines the ethernet proto for ARP,
so we could use it instead of the literal number '1'.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/ipv4/netfilter/nf_log_arp.c

index e7ad950cf9ef9a7f7b4e92ac146e1f92f6c20c19..cf8f2d4e867a8dd0483b6397d2ba9f9f13619573 100644 (file)
@@ -62,7 +62,7 @@ static void dump_arp_packet(struct nf_log_buf *m,
        /* If it's for Ethernet and the lengths are OK, then log the ARP
         * payload.
         */
-       if (ah->ar_hrd != htons(1) ||
+       if (ah->ar_hrd != htons(ARPHRD_ETHER) ||
            ah->ar_hln != ETH_ALEN ||
            ah->ar_pln != sizeof(__be32))
                return;