diff options
author | Patrick McHardy <kaber@trash.net> | 2007-07-14 21:52:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-07-14 21:52:02 -0400 |
commit | a0a400d79e3dd7843e7e81baa3ef2957bdc292d0 (patch) | |
tree | 1391190938fb43587967f44f0ab139a2522b4a65 /include/linux/netdevice.h | |
parent | 24023451c8df726692e2f52288a20870d13b501f (diff) |
[NET]: dev_mcast: add multicast list synchronization helpers
The method drivers currently use to synchronize multicast lists is not
very pretty:
- walk the multicast list
- search each entry on a copy of the previous list
- if new add to lower device
- walk the copy of the previous list
- search each entry on the current list
- if removed delete from lower device
- copy entire list
This patch adds a new field to struct dev_addr_list to store the
synchronization state and adds two helper functions for synchronization
and cleanup.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f193aba30384..e5af458ab04b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -190,6 +190,7 @@ struct dev_addr_list | |||
190 | struct dev_addr_list *next; | 190 | struct dev_addr_list *next; |
191 | u8 da_addr[MAX_ADDR_LEN]; | 191 | u8 da_addr[MAX_ADDR_LEN]; |
192 | u8 da_addrlen; | 192 | u8 da_addrlen; |
193 | u8 da_synced; | ||
193 | int da_users; | 194 | int da_users; |
194 | int da_gusers; | 195 | int da_gusers; |
195 | }; | 196 | }; |
@@ -1103,6 +1104,8 @@ extern int dev_unicast_delete(struct net_device *dev, void *addr, int alen); | |||
1103 | extern int dev_unicast_add(struct net_device *dev, void *addr, int alen); | 1104 | extern int dev_unicast_add(struct net_device *dev, void *addr, int alen); |
1104 | extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all); | 1105 | extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all); |
1105 | extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly); | 1106 | extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly); |
1107 | extern int dev_mc_sync(struct net_device *to, struct net_device *from); | ||
1108 | extern void dev_mc_unsync(struct net_device *to, struct net_device *from); | ||
1106 | extern void dev_mc_discard(struct net_device *dev); | 1109 | extern void dev_mc_discard(struct net_device *dev); |
1107 | extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all); | 1110 | extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all); |
1108 | extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); | 1111 | extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); |