From: Apple Date: Wed, 13 Mar 2019 22:48:02 +0000 (+0000) Subject: network_cmds-543.260.3.tar.gz X-Git-Tag: macos-10145^0 X-Git-Url: https://git.saurik.com/apple/network_cmds.git/commitdiff_plain/b8a2331515f134291276e6b0a1c1a0fd2e5038cd network_cmds-543.260.3.tar.gz --- diff --git a/ifconfig.tproj/ifmedia.c b/ifconfig.tproj/ifmedia.c index 5c36406..f03e995 100644 --- a/ifconfig.tproj/ifmedia.c +++ b/ifconfig.tproj/ifmedia.c @@ -113,7 +113,7 @@ media_status(int s) (void) memset(&ifmr, 0, sizeof(ifmr)); (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { + if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)&ifmr) < 0) { /* * Interface doesn't support SIOC{G,S}IFMEDIA. */ @@ -130,9 +130,8 @@ media_status(int s) err(1, "malloc"); ifmr.ifm_ulist = media_list; - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) - err(1, "SIOCGIFMEDIA"); - + if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)&ifmr) < 0) + err(1, "SIOCGIFXMEDIA"); printf("\tmedia: "); print_media_word(ifmr.ifm_current, 1); if (ifmr.ifm_active != ifmr.ifm_current) { @@ -217,8 +216,8 @@ ifmedia_getstate(int s) * the current media type and the top-level type. */ - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) < 0) { - err(1, "SIOCGIFMEDIA"); + if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)ifmr) < 0) { + err(1, "SIOCGIFXMEDIA"); } if (ifmr->ifm_count == 0) @@ -229,8 +228,8 @@ ifmedia_getstate(int s) err(1, "malloc"); ifmr->ifm_ulist = mwords; - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) < 0) - err(1, "SIOCGIFMEDIA"); + if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)ifmr) < 0) + err(1, "SIOCGIFXMEDIA"); } return ifmr;