]> git.baikalelectronics.ru Git - kernel.git/commit
net: Correctly sync addresses from multiple sources to single device
authorVlad Yasevich <vyasevic@redhat.com>
Wed, 22 Jan 2014 17:54:15 +0000 (12:54 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Jan 2014 21:06:34 +0000 (13:06 -0800)
commit11ec454b311c2c4c273ef7d0a709ce3f118860ea
treeb92a6e3856decba5f1e2392dbbfb55387223030a
parent2d85ca0fa5413d0f8889e4dc55e45f89374a7bae
net: Correctly sync addresses from multiple sources to single device

When we have multiple devices attempting to sync the same address
to a single destination, each device should be permitted to sync
it once.  To accomplish this, pass the 'sync_cnt' of the source
address when adding the addresss to the lower device.  'sync_cnt'
tracks how many time a given address has been succefully synced.
This way, we know that if the 'sync_cnt' passed in is 0, we should
sync this address.

Also, turn 'synced' member back into the counter as was originally
done in
   commit 1c96b5b61580125ad25f4c8b435fb0c397a0f2a3.
   net: count hw_addr syncs so that unsync works properly.
It tracks how many time a given address has been added via a
'sync' operation.  For every successfull 'sync' the counter is
incremented, and for ever 'unsync', the counter is decremented.
This makes sure that the address will be properly removed from
the the lower device when all the upper devices have removed it.

Reported-by: Andrey Dmitrov <andrey.dmitrov@oktetlabs.ru>
CC: Andrey Dmitrov <andrey.dmitrov@oktetlabs.ru>
CC: Alexandra N. Kossovsky <Alexandra.Kossovsky@oktetlabs.ru>
CC: Konstantin Ushakov <Konstantin.Ushakov@oktetlabs.ru>
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev_addr_lists.c