Skip to content

Commit

Permalink
flow_dissector: do not break if ports are not needed in flowlabel
Browse files Browse the repository at this point in the history
This restored previous behaviour. If caller does not want ports to be
filled, we should not break.

Fixes: 06635a3 ("flow_dissect: use programable dissector in skb_flow_dissect and friends")
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed May 22, 2015
1 parent bd5850d commit 12c227e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions net/core/flow_dissector.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
key_basic->ip_proto = ip_proto;
key_basic->thoff = (u16)nhoff;

if (!skb_flow_dissector_uses_key(flow_dissector,
FLOW_DISSECTOR_KEY_PORTS))
break;
key_ports = skb_flow_dissector_target(flow_dissector,
FLOW_DISSECTOR_KEY_PORTS,
target_container);
key_ports->ports = flow_label;
if (skb_flow_dissector_uses_key(flow_dissector,
FLOW_DISSECTOR_KEY_PORTS)) {
key_ports = skb_flow_dissector_target(flow_dissector,
FLOW_DISSECTOR_KEY_PORTS,
target_container);
key_ports->ports = flow_label;
}

return true;
}
Expand Down

0 comments on commit 12c227e

Please sign in to comment.