Skip to content

Instantly share code, notes, and snippets.

@kjmkznr
Created August 29, 2010 06:26
Show Gist options
  • Save kjmkznr/556032 to your computer and use it in GitHub Desktop.
Save kjmkznr/556032 to your computer and use it in GitHub Desktop.
diff -uNr r8168-8.018.00/src/r8168_n.c r8168-8.018.00.new/src/r8168_n.c
--- r8168-8.018.00/src/r8168_n.c 2010-03-31 14:48:19.000000000 +0900
+++ r8168-8.018.00.new/src/r8168_n.c 2010-08-27 12:32:38.755822272 +0900
@@ -8916,20 +8916,25 @@
AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
AcceptAllPhys;
mc_filter[1] = mc_filter[0] = 0xffffffff;
- } else if ((dev->mc_count > multicast_filter_limit)
+ } else if ((netdev_mc_count(dev) > multicast_filter_limit)
|| (dev->flags & IFF_ALLMULTI)) {
/* Too many to filter perfectly -- accept all multicasts. */
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
mc_filter[1] = mc_filter[0] = 0xffffffff;
} else {
- struct dev_mc_list *mclist;
+ struct netdev_hw_addr *ha;
rx_mode = AcceptBroadcast | AcceptMyPhys;
mc_filter[1] = mc_filter[0] = 0;
- for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
- i++, mclist = mclist->next) {
- int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
+ i = 0;
+ netdev_for_each_mc_addr(ha, dev) {
+ int bit_nr;
+ if( i < netdev_mc_count(dev) ){
+ break;
+ }
+ bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
rx_mode |= AcceptMulticast;
+ i++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment