[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1472668466.3889.3.camel@gmail.com>
Date: Wed, 31 Aug 2016 11:34:26 -0700
From: Greg <gvrose8192@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: netdev@...r.kernel.org, Greg Rose <grose@...htfleet.com>
Subject: Re: [PATCH] net/ethernet: Use ether_addr_copy rather than memcpy
On Wed, 2016-08-31 at 11:32 -0700, Eric Dumazet wrote:
> On Wed, 2016-08-31 at 09:32 -0700, Greg Rose wrote:
> > I'm not sure why this hasn't been done before because it seems obvious,
> > so maybe there is some reason that memcpy is used instead of
> > ether_addr_copy in this code. But let's try this anyway.
> >
> > Change memcpy to ether_addr_copy.
>
> ...
>
> >
> > @@ -211,7 +211,7 @@ EXPORT_SYMBOL(eth_type_trans);
> > int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr)
> > {
> > const struct ethhdr *eth = eth_hdr(skb);
> > - memcpy(haddr, eth->h_source, ETH_ALEN);
> > + ether_addr_copy(haddr, eth->h_source);
>
>
> Please carefully read ether_addr_copy() comments.
>
> Not all arches are like x86
Thanks Eric, Joe set me straight already.
- Greg
>
>
>
Powered by blists - more mailing lists