]> git.proxmox.com Git - mirror_ovs.git/commitdiff
netdev-tc-offloads: Do not set 0 port attribute to TC tunnel
authorEli Britstein <elibr@mellanox.com>
Wed, 26 Dec 2018 07:34:35 +0000 (09:34 +0200)
committerSimon Horman <simon.horman@netronome.com>
Sat, 29 Dec 2018 00:14:50 +0000 (09:14 +0900)
For non UDP tunnels as GRE there is no UDP port, i.e initialized to 0.

Do not set the port attribute in such case.

Signed-off-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
lib/netdev-tc-offloads.c
lib/tc.c

index 606a4f4db45da00c0f46c8428f6e199bc138f104..5e6f6995185e9addf46fe4ba485e505dcb2ae8bd 100644 (file)
@@ -651,8 +651,10 @@ parse_tc_flower_to_match(struct tc_flower *flower,
                     nl_msg_put_u8(buf, OVS_TUNNEL_KEY_ATTR_TTL,
                                   action->encap.ttl);
                 }
-                nl_msg_put_be16(buf, OVS_TUNNEL_KEY_ATTR_TP_DST,
-                                action->encap.tp_dst);
+                if (action->encap.tp_dst) {
+                    nl_msg_put_be16(buf, OVS_TUNNEL_KEY_ATTR_TP_DST,
+                                    action->encap.tp_dst);
+                }
                 if (!action->encap.no_csum) {
                     nl_msg_put_u8(buf, OVS_TUNNEL_KEY_ATTR_CSUM,
                                   !action->encap.no_csum);
index 47127ca2ce900e8a8218e1636677645b5e704be9..5681ee0961b162d57c6dcd019224a725eaf94a89 100644 (file)
--- a/lib/tc.c
+++ b/lib/tc.c
@@ -1661,7 +1661,9 @@ nl_msg_put_act_tunnel_key_set(struct ofpbuf *request, ovs_be64 id,
         if (ttl) {
             nl_msg_put_u8(request, TCA_TUNNEL_KEY_ENC_TTL, ttl);
         }
-        nl_msg_put_be16(request, TCA_TUNNEL_KEY_ENC_DST_PORT, tp_dst);
+        if (tp_dst) {
+            nl_msg_put_be16(request, TCA_TUNNEL_KEY_ENC_DST_PORT, tp_dst);
+        }
         nl_msg_put_act_tunnel_geneve_option(request, tun_metadata);
         nl_msg_put_u8(request, TCA_TUNNEL_KEY_NO_CSUM, no_csum);
     }
@@ -2035,7 +2037,9 @@ nl_msg_put_flower_tunnel(struct ofpbuf *request, struct tc_flower *flower)
         nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TTL, ttl);
         nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TTL_MASK, ttl_mask);
     }
-    nl_msg_put_be16(request, TCA_FLOWER_KEY_ENC_UDP_DST_PORT, tp_dst);
+    if (tp_dst) {
+        nl_msg_put_be16(request, TCA_FLOWER_KEY_ENC_UDP_DST_PORT, tp_dst);
+    }
     nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_KEY_ID, id);
     nl_msg_put_flower_tunnel_opts(request, TCA_FLOWER_KEY_ENC_OPTS,
                                   flower->key.tunnel.metadata);