summaryrefslogtreecommitdiffstats
path: root/sys/net/route.h
diff options
context:
space:
mode:
authorqingli <qingli@FreeBSD.org>2010-03-11 17:56:46 +0000
committerqingli <qingli@FreeBSD.org>2010-03-11 17:56:46 +0000
commitcde322640ac967dbb1cf657d5695d8b8cf4c864b (patch)
treeb70ed30a030af65480f44c2f15dbd0cd15652910 /sys/net/route.h
parent2684d78c89ad7cfd18346398691e6e03d263f6c6 (diff)
downloadFreeBSD-src-cde322640ac967dbb1cf657d5695d8b8cf4c864b.zip
FreeBSD-src-cde322640ac967dbb1cf657d5695d8b8cf4c864b.tar.gz
The if_tap interface is of IFT_ETHERNET type, but it
does not set or update the if_link_state variable. As such RT_LINK_IS_UP() fails for the if_tap interface. Also, the RT_LINK_IS_UP() needs to bypass all loopback interfaces because loopback interfaces are considered up logically as long as the system is running. This patch fixes the above issues by setting and updating the if_link_state variable when the tap interface is opened or closed respectively. Similary approach is already done in the if_tun device. MFC after: 3 days
Diffstat (limited to 'sys/net/route.h')
-rw-r--r--sys/net/route.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/route.h b/sys/net/route.h
index b337f32..8c35678 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -319,7 +319,9 @@ struct rt_addrinfo {
#ifdef _KERNEL
-#define RT_LINK_IS_UP(ifp) ((ifp)->if_link_state == LINK_STATE_UP)
+#define RT_LINK_IS_UP(ifp) (((ifp)->if_flags & \
+ (IFF_LOOPBACK | IFF_POINTOPOINT)) \
+ || (ifp)->if_link_state == LINK_STATE_UP)
#define RT_LOCK_INIT(_rt) \
mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK)
OpenPOWER on IntegriCloud