diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2007-05-16 09:24:08 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2007-05-16 09:24:08 +0000 |
commit | d081e8afa7051794c0cecf7e74265a50cfe0e177 (patch) | |
tree | 45fc534adec4074db1177b49b2ad13190179d04f /sys | |
parent | cc2740ca04e54245ef204caac53b127bd2516589 (diff) |
count the number of multicast ranges that are kept in the list of multicast
addresses in struct arpcom. this lets a nic driver easily see if it wants
allmulti behaviour, which in turn means we can clean some code up.
ok jason@ claudio@ norby@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_ethersubr.c | 6 | ||||
-rw-r--r-- | sys/netinet/if_ether.h | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 45d030e548a..4818545a3ca 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ethersubr.c,v 1.106 2007/03/18 23:23:17 mpf Exp $ */ +/* $OpenBSD: if_ethersubr.c,v 1.107 2007/05/16 09:24:07 dlg Exp $ */ /* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */ /* @@ -1103,6 +1103,8 @@ ether_addmulti(ifr, ac) enm->enm_refcount = 1; LIST_INSERT_HEAD(&ac->ac_multiaddrs, enm, enm_list); ac->ac_multicnt++; + if (bcmp(addrlo, addrhi, ETHER_ADDR_LEN) != 0) + ac->ac_multirangecnt++; splx(s); /* * Return ENETRESET to inform the driver that the list has changed @@ -1151,6 +1153,8 @@ ether_delmulti(ifr, ac) LIST_REMOVE(enm, enm_list); free(enm, M_IFMADDR); ac->ac_multicnt--; + if (bcmp(addrlo, addrhi, ETHER_ADDR_LEN) != 0) + ac->ac_multirangecnt--; splx(s); /* * Return ENETRESET to inform the driver that the list has changed diff --git a/sys/netinet/if_ether.h b/sys/netinet/if_ether.h index 5c85bcfab75..342e81eb258 100644 --- a/sys/netinet/if_ether.h +++ b/sys/netinet/if_ether.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.h,v 1.38 2006/06/28 12:13:24 claudio Exp $ */ +/* $OpenBSD: if_ether.h,v 1.39 2007/05/16 09:24:07 dlg Exp $ */ /* $NetBSD: if_ether.h,v 1.22 1996/05/11 13:00:00 mycroft Exp $ */ /* @@ -158,8 +158,10 @@ struct arpcom { struct ifnet ac_if; /* network-visible interface */ u_int8_t ac_enaddr[ETHER_ADDR_LEN]; /* ethernet hardware address */ char ac__pad[2]; /* pad for some machines */ - LIST_HEAD(, ether_multi) ac_multiaddrs; /* list of ether multicast addrs */ - int ac_multicnt; /* length of ac_multiaddrs list */ + LIST_HEAD(, ether_multi) ac_multiaddrs; /* list of multicast addrs */ + int ac_multicnt; /* length of ac_multiaddrs */ + int ac_multirangecnt; /* number of mcast ranges */ + }; struct llinfo_arp { |