flow_dissector: do not break if ports are not needed in flowlabel
authorJiri Pirko <jiri@resnulli.us>
Fri, 22 May 2015 09:05:58 +0000 (11:05 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 May 2015 17:59:02 +0000 (13:59 -0400)
This restored previous behaviour. If caller does not want ports to be
filled, we should not break.

Fixes: 06635a35d13d ("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>
net/core/flow_dissector.c

index 703d05916a8097ff839a57e8dfa251e076371e82..1f2d89300b1afd3d2319f10035e74ba35038d816 100644 (file)
@@ -221,13 +221,13 @@ flow_label:
                        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;
                }