From: Justin Pettit Date: Wed, 14 Jan 2009 22:52:59 +0000 (-0800) Subject: Check wildcards for in_port != out_port output validation. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b580f69f3dfacee49532f71abd72755a09eabd4;p=openvswitch Check wildcards for in_port != out_port output validation. OpenFlow requires that traffic that is to be sent out the interface it came in on use the OFPP_IN_PORT virtual port. The action validation code that enforces this ignored the wildcards field, which meant it was using the garbage 'in_port' value for this check. --- diff --git a/datapath/dp_act.c b/datapath/dp_act.c index 56104506..379af117 100644 --- a/datapath/dp_act.c +++ b/datapath/dp_act.c @@ -26,7 +26,8 @@ validate_output(struct datapath *dp, const struct sw_flow_key *key, { struct ofp_action_output *oa = (struct ofp_action_output *)ah; - if (oa->port == htons(OFPP_NONE) || oa->port == key->in_port) + if (oa->port == htons(OFPP_NONE) || + (!(key->wildcards & OFPFW_IN_PORT) && oa->port == key->in_port)) return OFPBAC_BAD_OUT_PORT; return ACT_VALIDATION_OK;