patch-1.3.44 linux/net/core/dev_mcast.c
Next file: linux/net/core/skbuff.c
Previous file: linux/net/ax25/af_ax25.c
Back to the patch index
Back to the overall index
- Lines: 83
- Date:
Fri Nov 24 16:39:54 1995
- Orig file:
v1.3.43/linux/net/core/dev_mcast.c
- Orig date:
Mon Oct 23 18:02:22 1995
diff -u --recursive --new-file v1.3.43/linux/net/core/dev_mcast.c linux/net/core/dev_mcast.c
@@ -12,6 +12,7 @@
* Alan Cox : Update the device on a real delete
* rather than any time but...
* Alan Cox : IFF_ALLMULTI support.
+ * Alan Cox : New format set_multicast_list() calls.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -60,9 +61,6 @@
void dev_mc_upload(struct device *dev)
{
- struct dev_mc_list *dmi;
- char *data, *tmp;
-
/* Don't do anything till we up the interface
[dev_open will call this function so the list will
stay sane] */
@@ -70,7 +68,6 @@
if(!(dev->flags&IFF_UP))
return;
-
/*
* Devices with no set multicast don't get set
*/
@@ -78,55 +75,7 @@
if(dev->set_multicast_list==NULL)
return;
- /*
- * Promiscuous is promiscuous - so no filter needed
- */
-
- if(dev->flags&IFF_PROMISC)
- {
- dev->set_multicast_list(dev, -1, NULL);
- return;
- }
-
- /*
- * All multicasts. Older cards will interpret this as
- * promisc mode, which is the next best thing.
- */
-
- if(dev->flags&IFF_ALLMULTI)
- {
- dev->set_multicast_list(dev, -2, NULL);
- return;
- }
-
- /*
- * No multicasts
- */
-
- if(dev->mc_count==0)
- {
- dev->set_multicast_list(dev,0,NULL);
- return;
- }
-
- /*
- * The drivers need changing to process the list themselves... this is
- * a mess.
- */
-
- data=kmalloc(dev->mc_count*dev->addr_len, GFP_KERNEL);
- if(data==NULL)
- {
- printk("Unable to get memory to set multicast list on %s\n",dev->name);
- return;
- }
- for(tmp = data, dmi=dev->mc_list;dmi!=NULL;dmi=dmi->next)
- {
- memcpy(tmp,dmi->dmi_addr, dmi->dmi_addrlen);
- tmp+=dev->addr_len;
- }
- dev->set_multicast_list(dev,dev->mc_count,data);
- kfree(data);
+ dev->set_multicast_list(dev);
}
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this