From: Eric Dumazet Date: Thu, 26 Sep 2013 15:44:06 +0000 (-0700) Subject: net: flow_dissector: fix thoff for IPPROTO_AH X-Git-Tag: v3.11.5~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56fee7fee4bfbcb812eb719d1937eda8ddabc059;p=thirdparty%2Fkernel%2Fstable.git net: flow_dissector: fix thoff for IPPROTO_AH [ Upstream commit b86783587b3d1d552326d955acee37eac48800f1 ] In commit 8ed781668dd49 ("flow_keys: include thoff into flow_keys for later usage"), we missed that existing code was using nhoff as a temporary variable that could not always contain transport header offset. This is not a problem for TCP/UDP because port offset (@poff) is 0 for these protocols. Signed-off-by: Eric Dumazet Cc: Daniel Borkmann Cc: Nikolay Aleksandrov Acked-by: Nikolay Aleksandrov Acked-by: Daniel Borkmann Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index 9c475f1ff83fe..52d0f83560718 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c @@ -150,8 +150,8 @@ ipv6: if (poff >= 0) { __be32 *ports, _ports; - nhoff += poff; - ports = skb_header_pointer(skb, nhoff, sizeof(_ports), &_ports); + ports = skb_header_pointer(skb, nhoff + poff, + sizeof(_ports), &_ports); if (ports) flow->ports = *ports; }