Skip to content
Browse files

allows the existence of down but enabled multicast interfaces

  • Loading branch information...
1 parent d68d498 commit f9a1c783a0eb323f9674fec3b025751858e832a8 suz committed May 21, 2003
Showing with 13 additions and 11 deletions.
  1. +7 −7 kame/kame/pim6sd/config.c
  2. +6 −4 kame/kame/pim6sd/vif.c
View
14 kame/kame/pim6sd/config.c
@@ -1,4 +1,4 @@
-/* $KAME: config.c,v 1.33 2003/02/05 15:30:32 suz Exp $ */
+/* $KAME: config.c,v 1.34 2003/05/21 06:54:34 suz Exp $ */
/*
* Copyright (c) 1998-2001
@@ -136,7 +136,6 @@ config_vifs_from_kernel()
flags = ifa->ifa_flags;
-
/*
* Get netmask of the address.
*/
@@ -210,7 +209,7 @@ config_vifs_from_kernel()
v = find_vif(ifa->ifa_name, DONT_CREATE, default_vif_status);
if (v != NULL) {
add_phaddr(v, &addr, &mask, rmt);
- continue;
+ goto bypass_initial_addrconf;
}
total_interfaces++;
@@ -225,7 +224,6 @@ config_vifs_from_kernel()
ifa->ifa_name);
continue;
}
-
v->uv_dst_addr = allpim6routers_group;
v->uv_subnetmask = mask;
strncpy(v->uv_name, ifa->ifa_name, IFNAMSIZ);
@@ -237,7 +235,8 @@ config_vifs_from_kernel()
v->uv_prefix.sin6_addr.s6_addr[i] =
addr.sin6_addr.s6_addr[i] & mask.s6_addr[i];
- if(flags & IFF_POINTOPOINT)
+ bypass_initial_addrconf:
+ if (flags & IFF_POINTOPOINT)
v->uv_flags |=(VIFF_REXMIT_PRUNES | VIFF_POINT_TO_POINT);
/*
@@ -258,8 +257,9 @@ config_vifs_from_kernel()
net6name(&v->uv_prefix.sin6_addr,&mask),
numvifs,v->uv_rate_limit);
- if( !(flags & IFF_UP))
- {
+ if (flags & IFF_UP) {
+ v->uv_flags &= ~VIFF_DOWN;
+ } else {
v->uv_flags |= VIFF_DOWN;
vifs_down = TRUE;
}
View
10 kame/kame/pim6sd/vif.c
@@ -1,4 +1,4 @@
-/* $KAME: vif.c,v 1.36 2003/05/21 06:47:39 suz Exp $ */
+/* $KAME: vif.c,v 1.37 2003/05/21 06:54:34 suz Exp $ */
/*
* Copyright (c) 1998-2001
@@ -168,8 +168,11 @@ void init_vifs()
for (vifi = 0, v = uvifs; vifi < numvifs; ++vifi, ++v) {
struct phaddr *p;
+ if (v->uv_flags & (VIFF_DISABLED | MIFF_REGISTER))
+ continue;
- if (v->uv_flags & (VIFF_DISABLED | VIFF_DOWN | MIFF_REGISTER))
+ enabled_vifs++;
+ if (v->uv_flags & VIFF_DOWN)
continue;
if (v->uv_linklocal == NULL)
log(LOG_ERR, 0,
@@ -179,15 +182,13 @@ void init_vifs()
/* If this vif has a global address, set its id to phys_vif */
if (phys_vif != -1)
continue;
-
for (p = v->uv_addrs; p; p = p->pa_next) {
if (!IN6_IS_ADDR_LINKLOCAL(&p->pa_addr.sin6_addr) &&
!IN6_IS_ADDR_SITELOCAL(&p->pa_addr.sin6_addr)) {
phys_vif = vifi;
break;
}
}
- enabled_vifs++;
}
if (enabled_vifs < 2)
log(LOG_ERR, 0, "can't forward: %s",
@@ -928,6 +929,7 @@ find_vif(ifname, create, default_policy)
v = &uvifs[numvifs++];
strncpy(v->uv_name, ifname, IFNAMSIZ);
v->uv_ifindex = ifindex;
+ v->uv_flags = VIFF_DOWN | default_policy;
return v;
}

0 comments on commit f9a1c78

Please sign in to comment.
Something went wrong with that request. Please try again.