nx-match: Trim variable length fields when encoding as actions.
authorJesse Gross <jesse@nicira.com>
Thu, 7 May 2015 01:05:18 +0000 (18:05 -0700)
committerJesse Gross <jesse@nicira.com>
Thu, 25 Jun 2015 18:08:57 +0000 (11:08 -0700)
commit4ede8c79eb9bc8fda4ef230615b6677cba8e6906
treee69293eed8fb376e81e04494de261a5a328e867b
parentdc3eb9539f17f3b9a2ea9221a86221196b5c002e
nx-match: Trim variable length fields when encoding as actions.

It is technically correct to send the entire maximum length of
a field when it is variable length. However, it is awkward to
do so and not what one would naively expect. Since receivers will
internally zero-extend fields, we can do the opposite and trim
off leading zeros. This results in encodings that are generally
sensible without specific knowledge of what is being transmitted.
(Of course, other implementations, such as controllers, may know
exactly the expected length of the field and are free to encode
it that way even if it has leading zeros.)

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/meta-flow.c
lib/meta-flow.h
lib/nx-match.c