All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Patrick McHardy <kaber@trash.net>
Cc: davem@davemloft.net, netdev@vger.kernel.org, xemul@openvz.org
Subject: Re: [VLAN 02/04]: Fix MAC address handling
Date: Wed, 11 Jul 2007 11:16:48 -0700	[thread overview]
Message-ID: <46951E90.6050608@candelatech.com> (raw)
In-Reply-To: <4695194A.3040908@trash.net>

Patrick McHardy wrote:
> Patrick McHardy wrote:
>> [VLAN]: Fix MAC address handling
>>
>> +static void vlan_sync_address(struct net_device *dev,
>> +			      struct net_device *vlandev)
>> +{
>> +	struct vlan_dev_info *vlan = VLAN_DEV_INFO(vlandev);
>> +
>> +	if (!compare_ether_addr(vlan->real_dev_addr, dev->dev_addr))
>> +		return;
>> +
>> +	if (compare_ether_addr(vlandev->dev_addr, dev->dev_addr))
>> +		dev_unicast_add(dev, vlandev->dev_addr, ETH_ALEN);
>> +	else
>> +		dev_unicast_delete(dev, vlandev->dev_addr, ETH_ALEN);
>> +
>> +	memcpy(vlan->real_dev_addr, dev->dev_addr, ETH_ALEN);
>> +}
> 
> 
> Unfortunately the one case I didn't test is still wrong :|
> 
> The above synchronization incorrectly removes the address in case
> if was different before and is still different afterwards. This
> patch is fixed and contains a few comments as an added bonus :)

The new patch looks good to me..though this is some tricky code
so I might have missed something...

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


  reply	other threads:[~2007-07-11 18:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-11 17:38 [RTNETLINK 00/04]: rtnl_link improvements Patrick McHardy
2007-07-11 17:38 ` [ETH 01/04]: Validate address in eth_mac_addr Patrick McHardy
2007-07-12  2:41   ` David Miller
2007-07-11 17:38 ` [VLAN 02/04]: Fix MAC address handling Patrick McHardy
2007-07-11 17:54   ` Patrick McHardy
2007-07-11 18:16     ` Ben Greear [this message]
2007-07-11 18:37       ` Patrick McHardy
2007-07-12  2:45     ` David Miller
2007-07-12  2:41   ` David Miller
2007-07-11 17:38 ` [RTNETLINK 03/04]: rtnl_link API simplification Patrick McHardy
2007-07-12  2:42   ` David Miller
2007-07-11 17:38 ` [RTNETLINK 04/04]: rtnl_link: allow specifying initial device address Patrick McHardy
2007-07-12  2:43   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46951E90.6050608@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=davem@davemloft.net \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.