Explorar o código

netfilter: ipset: Skip really non-first fragments for IPv6 when getting port/protocol

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Jozsef Kadlecsik %!s(int64=12) %!d(string=hai) anos
pai
achega
55524c219a
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      net/netfilter/ipset/ip_set_getport.c

+ 2 - 2
net/netfilter/ipset/ip_set_getport.c

@@ -116,12 +116,12 @@ ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
 {
 {
 	int protoff;
 	int protoff;
 	u8 nexthdr;
 	u8 nexthdr;
-	__be16 frag_off;
+	__be16 frag_off = 0;
 
 
 	nexthdr = ipv6_hdr(skb)->nexthdr;
 	nexthdr = ipv6_hdr(skb)->nexthdr;
 	protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr,
 	protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr,
 				   &frag_off);
 				   &frag_off);
-	if (protoff < 0)
+	if (protoff < 0 || (frag_off & htons(~0x7)) != 0)
 		return false;
 		return false;
 
 
 	return get_port(skb, nexthdr, protoff, src, port, proto);
 	return get_port(skb, nexthdr, protoff, src, port, proto);