From f25cb0ef9f6341648513e793a3162b32fc250d2b Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 11 Nov 2010 10:03:02 +0100 Subject: Implements link state detection. Also changes some symbol names (IFF_ADMIN_DOWN -> IFF_SHUTDOWN, IFF_LINK_UP -> IFF_ADMIN_UP). --- sysdep/bsd/krt-sock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sysdep/bsd') diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c index 9ae658d..53b30ca 100644 --- a/sysdep/bsd/krt-sock.c +++ b/sysdep/bsd/krt-sock.c @@ -456,7 +456,9 @@ krt_read_ifinfo(struct ks_msg *msg) f.flags = 0; if (fl & IFF_UP) - f.flags |= IF_LINK_UP; + f.flags |= IF_ADMIN_UP; + if (ifm->ifm_data.ifi_link_state != LINK_STATE_DOWN) + f.flags |= IF_LINK_UP; /* up or unknown */ if (fl & IFF_LOOPBACK) /* Loopback */ f.flags |= IF_MULTIACCESS | IF_LOOPBACK | IF_IGNORE; else if (fl & IFF_POINTOPOINT) /* PtP */ -- cgit v1.2.3