diff options
author | Ethan Jackson <ethan@nicira.com> | 2013-02-07 18:39:24 -0800 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2013-02-08 13:36:19 -0800 |
commit | 46739ae72b23bf6fcd56dc7ae743bce346300325 (patch) | |
tree | 833730d0a66d5b50a8b37a8d752c66bc3c22b1ab /ofproto | |
parent | f838b981e540230271a9695d91eeccc9ec168a3c (diff) |
tunnel: Treat in_key=0 the same as a missing in_key.
The documented behavior of ovs is that a missing key is the
same as a zero key. However, the tunneling code actually treated
them differently. This could cause problems with tunneling modes
such as vxlan which always have a key. Specifically, a tunnel with
no key configured, would send have to send traffic with a key of
zero. However, the same tunnel would drop incoming traffic with a
zero key because it was expecting there to be none at all.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'ofproto')
-rw-r--r-- | ofproto/tunnel.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c index d50cff80..5a4607e7 100644 --- a/ofproto/tunnel.c +++ b/ofproto/tunnel.c @@ -46,7 +46,6 @@ struct tnl_match { ovs_be32 ip_src; ovs_be32 ip_dst; uint32_t odp_port; - bool in_key_present; bool in_key_flow; }; @@ -95,7 +94,6 @@ tnl_port_add__(const struct ofport *ofport, uint32_t odp_port, tnl_port->match.in_key = cfg->in_key; tnl_port->match.ip_src = cfg->ip_src; tnl_port->match.ip_dst = cfg->ip_dst; - tnl_port->match.in_key_present = cfg->in_key_present; tnl_port->match.in_key_flow = cfg->in_key_flow; tnl_port->match.odp_port = odp_port; @@ -185,7 +183,6 @@ tnl_port_receive(struct flow *flow) match.ip_src = flow->tunnel.ip_dst; match.ip_dst = flow->tunnel.ip_src; match.in_key = flow->tunnel.tun_id; - match.in_key_present = flow->tunnel.flags & FLOW_TNL_F_KEY; tnl_port = tnl_find(&match); if (!tnl_port) { @@ -389,12 +386,10 @@ tnl_match_fmt(const struct tnl_match *match, struct ds *ds) ds_put_format(ds, IP_FMT"->"IP_FMT, IP_ARGS(match->ip_src), IP_ARGS(match->ip_dst)); - if (match->in_key_present) { - if (match->in_key_flow) { - ds_put_cstr(ds, ", key=flow"); - } else { - ds_put_format(ds, ", key=%#"PRIx64, ntohll(match->in_key)); - } + if (match->in_key_flow) { + ds_put_cstr(ds, ", key=flow"); + } else { + ds_put_format(ds, ", key=%#"PRIx64, ntohll(match->in_key)); } ds_put_format(ds, ", dp port=%"PRIu32, match->odp_port); |