aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2004-08-14 08:36:35 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2004-08-14 08:36:35 +0000
commite53915c97f1883770435cb4a764bfaceb2ff265e (patch)
tree5f42e81a2280f761dfed09577ab515a769f0b9e4 /sbin
parentd8e8b6755c1368714d1ae94e2759b2ee436362ef (diff)
downloadsrc-e53915c97f1883770435cb4a764bfaceb2ff265e.tar.gz
src-e53915c97f1883770435cb4a764bfaceb2ff265e.zip
Don't declare everything we find on a loopback interface for passive:
Only the actual loopback address should be declared passive, other addresses are very likely to be desirable to announce. Check for IFF_LOOPBACK instead of IFF_PASSIVE to determine if we have an unknown interface type.
Notes
Notes: svn path=/head/; revision=133715
Diffstat (limited to 'sbin')
-rw-r--r--sbin/routed/if.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sbin/routed/if.c b/sbin/routed/if.c
index ef8e4f48b839..b6e7a539cc07 100644
--- a/sbin/routed/if.c
+++ b/sbin/routed/if.c
@@ -804,7 +804,14 @@ ifinit(void)
}
if (ifs.int_if_flags & IFF_LOOPBACK) {
- ifs.int_state |= IS_PASSIVE | IS_NO_RIP | IS_NO_RDISC;
+ ifs.int_state |= IS_NO_RIP | IS_NO_RDISC;
+ if (ifs.int_addr == htonl(INADDR_LOOPBACK)) {
+ printf("loop %x\n", ifs.int_addr);
+ ifs.int_state |= IS_PASSIVE;
+ } else {
+ printf("alias %x\n", ifs.int_addr);
+ }
+
ifs.int_dstaddr = ifs.int_addr;
ifs.int_mask = HOST_MASK;
ifs.int_ripv1_mask = HOST_MASK;
@@ -1090,8 +1097,7 @@ ifinit(void)
continue;
}
- if (0 == (ifs.int_if_flags & (IFF_POINTOPOINT | IFF_BROADCAST))
- && !(ifs.int_state & IS_PASSIVE)) {
+ if (0 == (ifs.int_if_flags & (IFF_POINTOPOINT | IFF_BROADCAST | IFF_LOOPBACK))) {
trace_act("%s is neither broadcast, point-to-point,"
" nor loopback",
ifs.int_name);