提交 b8678358 编写于 作者: E Eric Dumazet 提交者: David S. Miller

net: flow_dissector: fix thoff for IPPROTO_AH

In commit 8ed78166 ("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: NEric Dumazet <edumazet@google.com>
Cc: Daniel Borkmann <dborkman@redhat.com>
Cc: Nikolay Aleksandrov <nikolay@redhat.com>
Acked-by: NNikolay Aleksandrov <nikolay@redhat.com>
Acked-by: NDaniel Borkmann <dborkman@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8386040b
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册