Commit 8df9e32e authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nf_tables_ipv6: setup pktinfo transport field on failure to parse

Make sure the pktinfo protocol fields are initialized if this fails to
parse the transport header.
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent beac5afa
...@@ -15,9 +15,10 @@ nft_set_pktinfo_ipv6(struct nft_pktinfo *pkt, ...@@ -15,9 +15,10 @@ nft_set_pktinfo_ipv6(struct nft_pktinfo *pkt,
nft_set_pktinfo(pkt, skb, state); nft_set_pktinfo(pkt, skb, state);
protohdr = ipv6_find_hdr(pkt->skb, &thoff, -1, &frag_off, NULL); 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; return -1;
}
pkt->tprot_set = true; pkt->tprot_set = true;
pkt->tprot = protohdr; pkt->tprot = protohdr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment