[ovs-git] Open vSwitch: datapath: Fix behavior of NLA_NESTED for pre-2.6.29 kernels. (master)

dev at openvswitch.org dev at openvswitch.org
Tue Feb 1 05:40:41 UTC 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  0700107651b6a774f8f7ba873259a5d5011e3cb0 (commit)
       via  d2a23af25132de097060d59f94465c94138c78a1 (commit)
      from  b46ccdf582946f30d80735345c533c23a7f035c0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0700107651b6a774f8f7ba873259a5d5011e3cb0
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=0700107651b6a774f8f7ba873259a5d5011e3cb0
Author: Ben Pfaff <blp at nicira.com>
		
datapath: Fix behavior of NLA_NESTED for pre-2.6.29 kernels.
		
Before v2.6.29, a NLA_NESTED attribute, if it was present, was not allowed
to be empty.  However, OVS depends on the ability to accept empty
attributes.  For example, a present but empty ODP_FLOW_ATTR_ACTIONS on
ODP_FLOW_CMD_SET replaces the existing set of actions by an empty "drop"
action, whereas a missing ODP_FLOW_ATTR_ACTIONS leaves the existing
actions, if any, unchanged.

NLA_NESTED is different from NLA_UNSPEC in only two ways:

* If the size of the nested attributes is zero, no further size checks
  are performed.

* If the size of the nested attributes is not zero and no length
  parameter is specified the minimum size of nested attributes is
  NLA_HDRLEN.

nla_parse_nested() validates that there is at least enough space for
NLA_HDRLEN, so neither of these conditions are important, and we might
as well use NLA_UNSPEC with old kernels.

Signed-off-by: Ben Pfaff <blp at nicira.com>
Acked-by: Jesse Gross <jesse at nicira.com>


commit d2a23af25132de097060d59f94465c94138c78a1
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=d2a23af25132de097060d59f94465c94138c78a1
Author: Ben Pfaff <blp at nicira.com>
		
dpif-linux: Always pass an actions attribute in dpif_flow_put().
		
The kernel expects that ODP_FLOW_NEW always has an ODP_FLOW_ATTR_ACTIONS
attribute, even though that attribute may be empty to drop all of the
packets in the flow.  Similarly, ODP_FLOW_SET as used by
dpif_linux_flow_put() should always have such an attribute, since it is
used by OVS to update the flow's actions.  So make it possible for
dpif_linux_flow_to_ofpbuf() to pass an empty actions attribute, and make
dpif_linux_flow_put() always force that behavior if the actions_len passed
to it is 0.

This fixes EINVAL error creating flows to drop packets.

Acked-by: Jesse Gross <jesse at nicira.com>


-----------------------------------------------------------------------

Summary of changes:
 .../linux-2.6/compat-2.6/include/net/netlink.h     |   25 ++++++++++++++++++++
 lib/dpif-linux.c                                   |   11 ++++++--
 2 files changed, 33 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Open vSwitch




More information about the git mailing list