[ovs-dev] [PATCH] Allow processing of RARP packets.

Mehak Mahajan mmahajan at nicira.com
Wed Oct 24 02:09:28 UTC 2012


Hey Jesse, Ben,

Thanks for reviewing this.
I have updated the commit message and also fixed the indentation.
I will send out an updated patch.

thanx!
mehak

On Tue, Oct 23, 2012 at 6:37 PM, Jesse Gross <jesse at nicira.com> wrote:

> On Tue, Oct 23, 2012 at 1:39 PM, Mehak Mahajan <mmahajan at nicira.com>
> wrote:
> > With this commit, the datapath will process the ARP header for
> > RARP packets, both request and reply.
> >
> > Signed-off-by: Mehak Mahajan <mmahajan at nicira.com>
>
> Can you mention that this also fixes the bug related to key_len?
>
> > diff --git a/datapath/flow.c b/datapath/flow.c
> > index b6efd35..4142027 100644
> > --- a/datapath/flow.c
> > +++ b/datapath/flow.c
> > @@ -735,18 +735,17 @@ int ovs_flow_extract(struct sk_buff *skb, u16
> in_port, struct sw_flow_key *key,
> >                                 && arp->ar_hln == ETH_ALEN
> >                                 && arp->ar_pln == 4) {
> >
> > -                       /* We only match on the lower 8 bits of the
> opcode. */
> > -                       if (ntohs(arp->ar_op) <= 0xff)
> > -                               key->ip.proto = ntohs(arp->ar_op);
> > -
> > -                       if (key->ip.proto == ARPOP_REQUEST
> > -                                       || key->ip.proto == ARPOP_REPLY)
> {
> > -                               memcpy(&key->ipv4.addr.src, arp->ar_sip,
> sizeof(key->ipv4.addr.src));
> > -                               memcpy(&key->ipv4.addr.dst, arp->ar_tip,
> sizeof(key->ipv4.addr.dst));
> > -                               memcpy(key->ipv4.arp.sha, arp->ar_sha,
> ETH_ALEN);
> > -                               memcpy(key->ipv4.arp.tha, arp->ar_tha,
> ETH_ALEN);
> > -                               key_len = SW_FLOW_KEY_OFFSET(ipv4.arp);
> > -                       }
> > +            /* We only match on the lower 8 bits of the opcode. */
> > +            if (ntohs(arp->ar_op) <= 0xff)
> > +                key->ip.proto = ntohs(arp->ar_op);
> > +
> > +            memcpy(&key->ipv4.addr.src, arp->ar_sip,
> > +                   sizeof(key->ipv4.addr.src));
> > +            memcpy(&key->ipv4.addr.dst, arp->ar_tip,
> > +                   sizeof(key->ipv4.addr.dst));
> > +            memcpy(key->ipv4.arp.sha, arp->ar_sha, ETH_ALEN);
> > +            memcpy(key->ipv4.arp.tha, arp->ar_tha, ETH_ALEN);
> > +            key_len = SW_FLOW_KEY_OFFSET(ipv4.arp);
> >                 }
>
> As Ben mentioned, the indentation here isn't right because kernel
> style uses tabs but this has spaces.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20121023/4a00f009/attachment-0003.html>


More information about the dev mailing list