Skip to content

Commit

Permalink
netfilter: ipset: add missing break statemtns in ip_set_get_ip_port()
Browse files Browse the repository at this point in the history
Don't fall through in the switch statement, otherwise IPv4 headers
are incorrectly parsed again as IPv6 and the return value will always
be 'false'.

Signed-off-by: Patrick McHardy <kaber@trash.net>
  • Loading branch information
Patrick McHardy committed Feb 2, 2011
1 parent e3e241b commit 316ed38
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/netfilter/ipset/ip_set_getport.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ ip_set_get_ip_port(const struct sk_buff *skb, u8 pf, bool src, __be16 *port)
switch (pf) {
case AF_INET:
ret = ip_set_get_ip4_port(skb, src, port, &proto);
break;
case AF_INET6:
ret = ip_set_get_ip6_port(skb, src, port, &proto);
break;
default:
return false;
}
Expand Down

0 comments on commit 316ed38

Please sign in to comment.