From 8d88402858f86c1b633ff64e2d3231a9ee8d10ee Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Sat, 13 Nov 2010 22:40:37 +0000 Subject: [PATCH] When setting a media with no sub-type specified also reset the type specific options along with the global ones so these options don't stick when f.e. switching to IFM_AUTO. MFC after: 2 weeks --- sbin/ifconfig/ifmedia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifmedia.c b/sbin/ifconfig/ifmedia.c index b805756f8923..889c54adf6e4 100644 --- a/sbin/ifconfig/ifmedia.c +++ b/sbin/ifconfig/ifmedia.c @@ -276,7 +276,7 @@ setmedia(const char *val, int d, int s, const struct afswtch *afp) IFM_TYPE(ifmr->ifm_ulist[0]) | subtype; if ((ifr.ifr_media & IFM_TMASK) == 0) { - ifr.ifr_media &= ~IFM_GMASK; + ifr.ifr_media &= ~(IFM_GMASK | IFM_OMASK); } ifmr->ifm_current = ifr.ifr_media;