summaryrefslogtreecommitdiff
path: root/ofproto/tunnel.c
diff options
context:
space:
mode:
authorJarno Rajahalme <jrajahalme@nicira.com>2015-03-13 13:27:19 -0700
committerJarno Rajahalme <jrajahalme@nicira.com>2015-03-13 13:27:19 -0700
commit7b7dcc762bb2056757d22b31c611060eda055d9a (patch)
tree2f122727bd36b183ca08b61afc897f87281b810b /ofproto/tunnel.c
parent8b1e55603f2541227b2e0cc1936dc107f83604a6 (diff)
downloadopenvswitch-7b7dcc762bb2056757d22b31c611060eda055d9a.tar.gz
ofproto-dpif-xlate: Honor skip_wildcards in translation.
There is no need to do anything with wildcards when skip_wildcards is true. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'ofproto/tunnel.c')
-rw-r--r--ofproto/tunnel.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c
index d079a246c..f621efbe9 100644
--- a/ofproto/tunnel.c
+++ b/ofproto/tunnel.c
@@ -333,7 +333,9 @@ tnl_ecn_ok(const struct flow *base_flow, struct flow *flow,
{
if (is_ip_any(base_flow)) {
if ((flow->tunnel.ip_tos & IP_ECN_MASK) == IP_ECN_CE) {
- wc->masks.nw_tos |= IP_ECN_MASK;
+ if (wc) {
+ wc->masks.nw_tos |= IP_ECN_MASK;
+ }
if ((base_flow->nw_tos & IP_ECN_MASK) == IP_ECN_NOT_ECT) {
VLOG_WARN_RL(&rl, "dropping tunnel packet marked ECN CE"
" but is not ECN capable");
@@ -362,21 +364,22 @@ tnl_xlate_init(const struct flow *base_flow, struct flow *flow,
* always unwildcard the 'in_port', we do not need to unwildcard
* the 'tunnel.ip_dst' for non-tunneled packets. */
if (tnl_port_should_receive(flow)) {
- wc->masks.tunnel.tun_id = OVS_BE64_MAX;
- wc->masks.tunnel.ip_src = OVS_BE32_MAX;
- wc->masks.tunnel.ip_dst = OVS_BE32_MAX;
- wc->masks.tunnel.flags = (FLOW_TNL_F_DONT_FRAGMENT |
- FLOW_TNL_F_CSUM |
- FLOW_TNL_F_KEY);
- wc->masks.tunnel.ip_tos = UINT8_MAX;
- wc->masks.tunnel.ip_ttl = UINT8_MAX;
- /* The tp_src and tp_dst members in flow_tnl are set to be always
- * wildcarded, not to unwildcard them here. */
- wc->masks.tunnel.tp_src = 0;
- wc->masks.tunnel.tp_dst = 0;
-
- memset(&wc->masks.pkt_mark, 0xff, sizeof wc->masks.pkt_mark);
-
+ if (wc) {
+ wc->masks.tunnel.tun_id = OVS_BE64_MAX;
+ wc->masks.tunnel.ip_src = OVS_BE32_MAX;
+ wc->masks.tunnel.ip_dst = OVS_BE32_MAX;
+ wc->masks.tunnel.flags = (FLOW_TNL_F_DONT_FRAGMENT |
+ FLOW_TNL_F_CSUM |
+ FLOW_TNL_F_KEY);
+ wc->masks.tunnel.ip_tos = UINT8_MAX;
+ wc->masks.tunnel.ip_ttl = UINT8_MAX;
+ /* The tp_src and tp_dst members in flow_tnl are set to be always
+ * wildcarded, not to unwildcard them here. */
+ wc->masks.tunnel.tp_src = 0;
+ wc->masks.tunnel.tp_dst = 0;
+
+ memset(&wc->masks.pkt_mark, 0xff, sizeof wc->masks.pkt_mark);
+ }
if (!tnl_ecn_ok(base_flow, flow, wc)) {
return false;
}