Commit
c6100d92142b (ovs-ofctl: Accept port keywords, OF1.1 port numbers,
reject port number 0.) intentionally prohibited using port 0, which is not
a valid OpenFlow port number, in OpenFlow commands and actions. However,
since then we have discovered that the NVP controller uses port 0 in
"resubmit" actions and hence in flow matches as well. This seems like a
valid enough use case; after all, the port number in a resubmit action is
really just an arbitrary number that need not (and preferably does not)
refer to an actual OpenFlow port. Therefore, this commit restores the
ability to use port 0.
(Only functions that parse OpenFlow commands and actions from strings, not
those that interpret binary OpenFlow coming in on OpenFlow connections,
were affected by this prohibition, so this only comes up in corner cases
anyhow.)
Reported-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
also the recommended way to specify these ports, for compatibility
with OpenFlow 1.1 and later (which use the OpenFlow 1.0 numbers
for these ports for different purposes).
- - Commands and actions that accept port numbers no longer accept port 0,
- which is not a valid port number in OpenFlow 1.0 and later.
- ovs-dpctl:
- Support requesting the port number with the "port_no" option in
the "add-if" command.
*portp = 0;
if (str_to_uint(s, 10, &port32)) {
- if (port32 == 0) {
- VLOG_WARN("port 0 is not a valid OpenFlow port number");
- return false;
- } else if (port32 < OFPP_MAX) {
+ if (port32 < OFPP_MAX) {
*portp = port32;
return true;
} else if (port32 < OFPP_FIRST_RESV) {
cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
+in_port=0 actions=resubmit:0
]])
AT_CHECK([ovs-ofctl parse-flows flows.txt
OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
OFPT_FLOW_MOD: ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00
OFPT_FLOW_MOD: ADD actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[0..63],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[64..127]
+OFPT_FLOW_MOD: ADD in_port=0 actions=resubmit:0
]])
AT_CLEANUP