summaryrefslogtreecommitdiff
path: root/lib/ofp-util.c
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2015-08-11 18:41:37 -0700
committerJesse Gross <jesse@nicira.com>2015-08-28 18:02:00 -0700
commit1cb20095c3c933aca1e7607ad2dd6ed9933b359e (patch)
tree12914dd8463ee6f6b3a702eb9f8e50c302a5619a /lib/ofp-util.c
parent14dd55a3e3496057e7a7e0281a782b180714348d (diff)
downloadopenvswitch-1cb20095c3c933aca1e7607ad2dd6ed9933b359e.tar.gz
tunnel: Support matching on the presence of Geneve options.
Sometimes it is useful to match only on whether a Geneve option is present even if the specific value is unimportant. A special case of this is zero length options where there is no value at all and the only information conveyed is whether the option was included in the packet. This operation was partially supported before but it was not consistent - in particular, options were never serialized through NXM/OXM unless they had a non-zero mask. Furthermore, zero length options were rejected altogether when they were installed through the Geneve map OpenFlow command. This adds support for these types of matches by making any NXM/OXM for tunnel metadata force a match on that field. In the case of a zero length option, both the value and mask of the NXM are ignored. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Diffstat (limited to 'lib/ofp-util.c')
-rw-r--r--lib/ofp-util.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index f8fbcef49..5331f8ce4 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -9185,8 +9185,7 @@ decode_geneve_table_mappings(struct ofpbuf *msg, unsigned int max_fields,
map->option_type = nx_map->option_type;
map->option_len = nx_map->option_len;
- if (map->option_len == 0 || map->option_len % 4 ||
- map->option_len > GENEVE_MAX_OPT_SIZE) {
+ if (map->option_len % 4 || map->option_len > GENEVE_MAX_OPT_SIZE) {
VLOG_WARN_RL(&bad_ofmsg_rl,
"geneve table option length (%u) is not a valid option size",
map->option_len);