Skip to content

Commit

Permalink
netfilter: ipset: Skip really non-first fragments for IPv6 when getti…
Browse files Browse the repository at this point in the history
…ng port/protocol

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
  • Loading branch information
Jozsef Kadlecsik committed Sep 16, 2013
1 parent d830f0f commit 55524c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/netfilter/ipset/ip_set_getport.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
{
int protoff;
u8 nexthdr;
__be16 frag_off;
__be16 frag_off = 0;

nexthdr = ipv6_hdr(skb)->nexthdr;
protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr,
&frag_off);
if (protoff < 0)
if (protoff < 0 || (frag_off & htons(~0x7)) != 0)
return false;

return get_port(skb, nexthdr, protoff, src, port, proto);
Expand Down

0 comments on commit 55524c2

Please sign in to comment.