From b2b1e460eb0142fb7e6e2a465dc386cd2a3bf452 Mon Sep 17 00:00:00 2001 From: Till Straumann Date: Thu, 23 Apr 2009 04:32:07 +0000 Subject: - added ifmedia_removeall(). --- bsd_eth_drivers/libbsdport/ifmedia.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) { -- cgit v1.2.3