Skip to content

Commit

Permalink
netfilter: nf_tables_ipv6: setup pktinfo transport field on failure t…
Browse files Browse the repository at this point in the history
…o parse

Make sure the pktinfo protocol fields are initialized if this fails to
parse the transport header.

Signed-off-by: Pablo Neira Ayuso <[email protected]>
  • Loading branch information
ummakynes committed Sep 12, 2016
1 parent beac5af commit 8df9e32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/net/netfilter/nf_tables_ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8df9e32

Please sign in to comment.