[ovs-dev] [encap v2 1/3] datapath: Allow flow key Netlink attributes to appear in any order.

Ben Pfaff blp at nicira.com
Mon Nov 14 23:09:06 UTC 2011


On Mon, Nov 14, 2011 at 01:04:04PM -0800, Jesse Gross wrote:
> On Sat, Nov 12, 2011 at 1:01 PM, Ben Pfaff <blp at nicira.com> wrote:
> > diff --git a/datapath/flow.c b/datapath/flow.c
> > index 9786c37..6caca2a 100644
> > --- a/datapath/flow.c
> > +++ b/datapath/flow.c
> > ??int flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp,
> > ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??const struct nlattr *attr)
> [...]
> > + ?? ?? ?? if (attrs & (1 << OVS_KEY_ATTR_ETHERTYPE)) {
> > + ?? ?? ?? ?? ?? ?? ?? swkey->eth.type = nla_get_be16(a[OVS_KEY_ATTR_ETHERTYPE]);
> > + ?? ?? ?? ?? ?? ?? ?? if (ntohs(swkey->eth.type) < 1536)
> > + ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? return -EINVAL;
> > + ?? ?? ?? ?? ?? ?? ?? attrs &= ~(1 << OVS_KEY_ATTR_ETHERTYPE);
> > + ?? ?? ?? } else {
> > + ?? ?? ?? ?? ?? ?? ?? swkey->eth.type = htons(ETH_P_802_2);
> > + ?? ?? ?? }
> > +
> > +
> > + ?? ?? ?? if (swkey->eth.type == htons(ETH_P_IP)) {
> 
> Double blank line here but otherwise looks good.
> Acked-by: Jesse Gross <jesse at nicira.com>

Fixed, thank you.



More information about the dev mailing list