diff options
author | ru <ru@FreeBSD.org> | 2001-12-03 15:12:45 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2001-12-03 15:12:45 +0000 |
commit | c55fbd48a87bd450592bb317754a6bf3961674ff (patch) | |
tree | 1bc894e746b26adb351d0bdc102ba830e953d289 /sbin/ifconfig | |
parent | 4dca6282046a6a28b66928743753259ee7460051 (diff) | |
download | FreeBSD-src-c55fbd48a87bd450592bb317754a6bf3961674ff.zip FreeBSD-src-c55fbd48a87bd450592bb317754a6bf3961674ff.tar.gz |
MTU and metric are available with NET_RT_IFLIST.
MFC after: 3 days
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 113acea..e2d20ac 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -123,8 +123,6 @@ struct netrange at_nr; /* AppleTalk net range */ char name[32]; int flags; -int metric; -int mtu; int setaddr; int setipdst; int setmask; @@ -1136,28 +1134,12 @@ status(afp, addrcount, sdl, ifm, ifam) if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0) err(1, "socket"); - /* - * XXX is it we are doing a SIOCGIFMETRIC etc for one family. - * is it possible that the metric and mtu can be different for - * each family? If so, we have a format problem, because the - * metric and mtu is printed on the global the flags line. - */ - if (ioctl(s, SIOCGIFMETRIC, (caddr_t)&ifr) < 0) - warn("ioctl (SIOCGIFMETRIC)"); - else - metric = ifr.ifr_metric; - - if (ioctl(s, SIOCGIFMTU, (caddr_t)&ifr) < 0) - warn("ioctl (SIOCGIFMTU)"); - else - mtu = ifr.ifr_mtu; - printf("%s: ", name); printb("flags", flags, IFFBITS); - if (metric) - printf(" metric %d", metric); - if (mtu) - printf(" mtu %d", mtu); + if (ifm->ifm_data.ifi_metric) + printf(" metric %ld", ifm->ifm_data.ifi_metric); + if (ifm->ifm_data.ifi_mtu) + printf(" mtu %ld", ifm->ifm_data.ifi_mtu); putchar('\n'); if (ioctl(s, SIOCGIFCAP, (caddr_t)&ifr) == 0) { |