]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/sched/act_tunnel_key.c
net/sched: act_tunnel_key: Don't dump dst port if it wasn't set
[linux.git] / net / sched / act_tunnel_key.c
index fad438c0f7a7d854099fae608e51d95bd22bcedf..c3b90fadaff67357d111f7aded3066e24a522097 100644 (file)
@@ -512,7 +512,9 @@ static int tunnel_key_dump(struct sk_buff *skb, struct tc_action *a,
                     nla_put_be32(skb, TCA_TUNNEL_KEY_ENC_KEY_ID, key_id)) ||
                    tunnel_key_dump_addresses(skb,
                                              &params->tcft_enc_metadata->u.tun_info) ||
-                   nla_put_be16(skb, TCA_TUNNEL_KEY_ENC_DST_PORT, key->tp_dst) ||
+                   (key->tp_dst &&
+                     nla_put_be16(skb, TCA_TUNNEL_KEY_ENC_DST_PORT,
+                                  key->tp_dst)) ||
                    nla_put_u8(skb, TCA_TUNNEL_KEY_NO_CSUM,
                               !(key->tun_flags & TUNNEL_CSUM)) ||
                    tunnel_key_opts_dump(skb, info))