Return no protocols if mask is supplied for unmaskable match
authorSimon Horman <horms@verge.net.au>
Thu, 31 Oct 2013 04:00:02 +0000 (13:00 +0900)
committerBen Pfaff <blp@nicira.com>
Thu, 31 Oct 2013 23:43:59 +0000 (16:43 -0700)
commitaf69bf199babd7b7b7752372e3e0a92835533b30
treeef20960de349c8da413b0a5ada19379f0cdca243
parent1f435c881c98ec9d4325bd7ecee7b137d807024a
Return no protocols if mask is supplied for unmaskable match

Currently if a mask is supplied for an unmaskable match then NOT_REACHED()
is called. The effect of this for a user calling ovs-vsctl with a match
that includes a mask which is not permitted is to politely inform them of
the error of their ways by calling abort and segfaulting.

This patch takes an alternate approach to return no protocols which has the
has the effect when that ovs-vsctl is called with a match that includes a
mask which is not permitted an error message of the following form is
displayed.

ovs-ofctl: none of the usable flow formats (none) is among the allowed flow formats (OpenFlow10,NXM)

This patch also updates the ovs-ofctl test to test matches with masks
where possible.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/meta-flow.c
tests/ovs-ofctl.at