Skip to content

Commit

Permalink
net: flow_dissector: fix thoff for IPPROTO_AH
Browse files Browse the repository at this point in the history
In commit 8ed7816 ("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 <edumazet@google.com>
Cc: Daniel Borkmann <dborkman@redhat.com>
Cc: Nikolay Aleksandrov <nikolay@redhat.com>
Acked-by: Nikolay Aleksandrov <nikolay@redhat.com>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Sep 30, 2013
1 parent 8386040 commit b867835
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/core/flow_dissector.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ bool skb_flow_dissect(const struct sk_buff *skb, struct flow_keys *flow)
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;
}
Expand Down

0 comments on commit b867835

Please sign in to comment.