netfilter: nf_tables_ipv6: setup pktinfo transport field on failure to parse
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 9 Sep 2016 10:42:50 +0000 (12:42 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 12 Sep 2016 16:52:04 +0000 (18:52 +0200)
Make sure the pktinfo protocol fields are initialized if this fails to
parse the transport header.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables_ipv6.h

index 6aeee47b1b5e08b2a537c3730f745c3c841f7597..1e0ffd5aea47eecdea750ab792b61887672c19c9 100644 (file)
@@ -15,9 +15,10 @@ nft_set_pktinfo_ipv6(struct nft_pktinfo *pkt,
        nft_set_pktinfo(pkt, skb, state);
 
        protohdr = ipv6_find_hdr(pkt->skb, &thoff, -1, &frag_off, NULL);
-       /* If malformed, drop it */
-       if (protohdr < 0)
+       if (protohdr < 0) {
+               nft_set_pktinfo_proto_unspec(pkt, skb);
                return -1;
+       }
 
        pkt->tprot_set = true;
        pkt->tprot = protohdr;