diff options
author | Till Straumann <strauman@slac.stanford.edu> | 2009-04-23 04:32:07 +0000 |
---|---|---|
committer | Till Straumann <strauman@slac.stanford.edu> | 2009-04-23 04:32:07 +0000 |
commit | b2b1e460eb0142fb7e6e2a465dc386cd2a3bf452 (patch) | |
tree | 865ee2652a7ba2e1d581ee539413a910ed64d4bc | |
parent | 1f018e42f77e622ebd9a75d4b4df47b129cbe1db (diff) |
- added ifmedia_removeall().
-rw-r--r-- | bsd_eth_drivers/libbsdport/ifmedia.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bsd_eth_drivers/libbsdport/ifmedia.c b/bsd_eth_drivers/libbsdport/ifmedia.c index 77c3bd3..719e020 100644 --- a/bsd_eth_drivers/libbsdport/ifmedia.c +++ b/bsd_eth_drivers/libbsdport/ifmedia.c @@ -50,6 +50,16 @@ struct ifmedia_entry *ifmen, *ifmep, *ifme; } } +void +ifmedia_removeall(struct ifmedia *ifm) +{ +struct ifmedia_entry *ifmen, *ifmep, *ifme; + for ( ifmep = LIST_FIRST(&ifm->ifm_list); ifmep; ifmep = ifmen ) { + ifmen = LIST_NEXT(ifmep, ifm_list); + free(ifmep, M_DEVBUF); + } +} + int ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm, u_long cmd) { |