diff options
author | Ben Pfaff <blp@nicira.com> | 2012-05-15 12:50:57 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-05-16 12:24:11 -0700 |
commit | 37cbc793a61c32926784f1dbe39b37f6bbdf9901 (patch) | |
tree | 320bfb89e0e7c757527304272a8c278a1a15c0c0 /lib/odp-util.c | |
parent | 4682afa0312f23b597f8c4e984b42b1f1780917e (diff) |
odp-util: Update ODPUTIL_FLOW_KEY_BYTES for current kernel flow format.
Before we submitted the kernel module upstream, we updated the flow format
by adding two fields to the description of packets with VLAN headers, but
we forgot to update ODPUTIL_FLOW_KEY_BYTES to reflect these changes. The
result was that a maximum-length flow did not fit in the given space.
This fixes a crash processing IPv6 neighbor discovery packets with VLAN
headers received in a tunnel configured with key=flow or in_key=flow.
This updates some comments to better describe the implications of
ODPUTIL_FLOW_KEY_BYTES (suggested by Justin).
This also updates test-odp.c so that it would have caught this problem, and
updates odp.at to demonstrate that a full 156 bytes are necessary. (To see
that, revert the change to ODPUTIL_FLOW_KEY_BYTES and run the test.)
Reported-by: Dan Wendlandt <dan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/odp-util.c')
-rw-r--r-- | lib/odp-util.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/odp-util.c b/lib/odp-util.c index cba26232..5e171ff6 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -1154,7 +1154,10 @@ ovs_to_odp_frag(uint8_t nw_frag) : OVS_FRAG_TYPE_LATER); } -/* Appends a representation of 'flow' as OVS_KEY_ATTR_* attributes to 'buf'. */ +/* Appends a representation of 'flow' as OVS_KEY_ATTR_* attributes to 'buf'. + * + * 'buf' must have at least ODPUTIL_FLOW_KEY_BYTES bytes of space, or be + * capable of being expanded to allow for that much space. */ void odp_flow_key_from_flow(struct ofpbuf *buf, const struct flow *flow) { |