On Fri, Jun 19, 2015 at 04:13:19PM -0700, Jesse Gross wrote: > 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 <je...@nicira.com>
Acked-by: Ben Pfaff <b...@nicira.com> I personally find this implementation of mf_field_len() easier to read (I know that's terribly nitpicky): int len = field_len(mf, value); if (mask && !is_all_ones(mask, mf->n_bytes)) { int mask_len = field_len(mf, mask); len = MAX(len, mask_len); } return len; _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev