diff options
author | 2016-04-18 06:20:23 +0000 | |
---|---|---|
committer | 2016-04-18 06:20:23 +0000 | |
commit | 040be03e9aedd029fb2d4fb0754da8453b681679 (patch) | |
tree | 7bb1d3b7afde404b2462bfd5668f223943cee5a5 | |
parent | allocate an array of entries, not pointers for the queues (diff) | |
download | wireguard-openbsd-040be03e9aedd029fb2d4fb0754da8453b681679.tar.xz wireguard-openbsd-040be03e9aedd029fb2d4fb0754da8453b681679.zip |
Print interface index after priority.
Suggestion from claudio@, ok benno@, sthen@
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index a92e343c44f..e8b74bbe174 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.319 2016/04/06 11:48:51 dlg Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.320 2016/04/18 06:20:23 mpi Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -2929,8 +2929,14 @@ status(int link, struct sockaddr_dl *sdl, int ls) strlen(ifrdesc.ifr_data)) printf("\tdescription: %s\n", ifrdesc.ifr_data); - if (!is_bridge(name) && ioctl(s, SIOCGIFPRIORITY, &ifrdesc) == 0) - printf("\tpriority: %d\n", ifrdesc.ifr_metric); + if (sdl != NULL) + printf("\tindex %u", sdl->sdl_index); + if (!is_bridge(name) && ioctl(s, SIOCGIFPRIORITY, &ifrdesc) == 0) { + printf("%cpriority %d\n", (sdl != NULL) ? ' ' : '\t', + ifrdesc.ifr_metric); + } else if (sdl != NULL) { + putchar('\n'); + } (void) memset(&ikardesc, 0, sizeof(ikardesc)); (void) strlcpy(ikardesc.ikar_name, name, sizeof(ikardesc.ikar_name)); if (ioctl(s, SIOCGETKALIVE, &ikardesc) == 0 && |