netfilter: nf_tables_netdev: remove redundant ip_hdr assignment
authorLiping Zhang <liping.zhang@spreadtrum.com>
Sun, 28 Aug 2016 08:59:52 +0000 (16:59 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 30 Aug 2016 09:41:04 +0000 (11:41 +0200)
We have already use skb_header_pointer to get the ip header pointer,
so there's no need to use ip_hdr again. Moreover, in NETDEV INGRESS
hook, ip header maybe not linear, so use ip_hdr is not appropriate,
remove it.

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

index 5eefe4a355c640cf85c8328740a877c6909880ba..75d696f11045779bd08503bb49ec954abc63eeb4 100644 (file)
@@ -30,7 +30,6 @@ nft_netdev_set_pktinfo_ipv4(struct nft_pktinfo *pkt,
        if (!iph)
                return;
 
-       iph = ip_hdr(skb);
        if (iph->ihl < 5 || iph->version != 4)
                return;