diff options
author | andre <andre@FreeBSD.org> | 2004-05-03 16:30:32 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2004-05-03 16:30:32 +0000 |
commit | 5ecba3f8bc331eb5358dee47690c267d8837f482 (patch) | |
tree | 5c8b72ab098e908fe432c889c989aad29492910e /sbin/route | |
parent | d18bda0b0d57709736e16b126ea61b5c23d1b83d (diff) | |
download | FreeBSD-src-5ecba3f8bc331eb5358dee47690c267d8837f482.zip FreeBSD-src-5ecba3f8bc331eb5358dee47690c267d8837f482.tar.gz |
Link state change notification of ethernet media to the routing socket.
o Print the link state for interface messages in monitor mode.
No objections by: sam, wpaul, ru, bms
Brucification by: bde
Diffstat (limited to 'sbin/route')
-rw-r--r-- | sbin/route/route.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c index 10fbee6..dcd1ddc 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1318,6 +1318,7 @@ print_rtmsg(rtm, msglen) struct ifma_msghdr *ifmam; #endif struct if_announcemsghdr *ifan; + char *state; if (verbose == 0) return; @@ -1334,7 +1335,19 @@ print_rtmsg(rtm, msglen) switch (rtm->rtm_type) { case RTM_IFINFO: ifm = (struct if_msghdr *)rtm; - (void) printf("if# %d, flags:", ifm->ifm_index); + (void) printf("if# %d, ", ifm->ifm_index); + switch (ifm->ifm_data.ifi_link_state) { + case LINK_STATE_DOWN: + state = "down"; + break; + case LINK_STATE_UP: + state = "up"; + break; + default: + state = "unknown"; + break; + } + (void) printf("link: %s, flags:", state); bprintf(stdout, ifm->ifm_flags, ifnetflags); pmsg_addrs((char *)(ifm + 1), ifm->ifm_addrs); break; |