mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 10:19:26 +00:00
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
This commit is contained in:
parent
7652802b06
commit
9063f422e2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=128878
@ -1318,6 +1318,7 @@ print_rtmsg(rtm, msglen)
|
|||||||
struct ifma_msghdr *ifmam;
|
struct ifma_msghdr *ifmam;
|
||||||
#endif
|
#endif
|
||||||
struct if_announcemsghdr *ifan;
|
struct if_announcemsghdr *ifan;
|
||||||
|
char *state;
|
||||||
|
|
||||||
if (verbose == 0)
|
if (verbose == 0)
|
||||||
return;
|
return;
|
||||||
@ -1334,7 +1335,19 @@ print_rtmsg(rtm, msglen)
|
|||||||
switch (rtm->rtm_type) {
|
switch (rtm->rtm_type) {
|
||||||
case RTM_IFINFO:
|
case RTM_IFINFO:
|
||||||
ifm = (struct if_msghdr *)rtm;
|
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);
|
bprintf(stdout, ifm->ifm_flags, ifnetflags);
|
||||||
pmsg_addrs((char *)(ifm + 1), ifm->ifm_addrs);
|
pmsg_addrs((char *)(ifm + 1), ifm->ifm_addrs);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user