Skip to content

Commit ad6dfbd

Browse files
soukjinbaegregkh
authored andcommitted
flow_dissector: do not dissect l4 ports for fragments
[ Upstream commit 6223071 ] Only first fragment has the sport/dport information, not the following ones. If we want consistent hash for all fragments, we need to ignore ports even for first fragment. This bug is visible for IPv6 traffic, if incoming fragments do not have a flow label, since skb_get_hash() will give different results for first fragment and following ones. It is also visible if any routing rule wants dissection and sport or dport. See commit 5e5d6fe ("ipv6: route: dissect flow in input path if fib rules need it") for details. [edumazet] rewrote the changelog completely. Fixes: 06635a3 ("flow_dissect: use programable dissector in skb_flow_dissect and friends") Signed-off-by: 배석진 <soukjin.bae@samsung.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 73aa1c8 commit ad6dfbd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎net/core/flow_dissector.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,8 +1026,8 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
10261026
break;
10271027
}
10281028

1029-
if (dissector_uses_key(flow_dissector,
1030-
FLOW_DISSECTOR_KEY_PORTS)) {
1029+
if (dissector_uses_key(flow_dissector, FLOW_DISSECTOR_KEY_PORTS) &&
1030+
!(key_control->flags & FLOW_DIS_IS_FRAGMENT)) {
10311031
key_ports = skb_flow_dissector_target(flow_dissector,
10321032
FLOW_DISSECTOR_KEY_PORTS,
10331033
target_container);

0 commit comments

Comments
 (0)