summaryrefslogtreecommitdiff
path: root/proto/ospf/iface.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-06-05 23:44:26 +0000
committerOndrej Filip <feela@network.cz>2000-06-05 23:44:26 +0000
commite5b5d18c1c8b33e76e954c0696e056fc11701631 (patch)
tree601de62d327c3fb3d030c239f53f52b5261f9af2 /proto/ospf/iface.c
parent5c18880e35f668d33a993be5b2854547a08d9199 (diff)
NBMA networks should work now.
Diffstat (limited to 'proto/ospf/iface.c')
-rw-r--r--proto/ospf/iface.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c
index c0d8770f..6435d390 100644
--- a/proto/ospf/iface.c
+++ b/proto/ospf/iface.c
@@ -33,7 +33,7 @@ iface_chstate(struct ospf_iface *ifa, u8 state)
{
if((state==OSPF_IS_BACKUP)||(state==OSPF_IS_DR))
{
- if(ifa->dr_sk==NULL)
+ if((ifa->dr_sk==NULL)&&(ifa->type!=OSPF_IT_NBMA))
{
DBG("%s: Adding new multicast socket for (B)DR\n", p->name);
ifa->dr_sk=sk_new(p->pool);
@@ -290,6 +290,7 @@ ospf_if_notify(struct proto *p, unsigned flags, struct iface *iface)
struct ospf_config *c=(struct ospf_config *)(p->cf);
struct ospf_area_config *ac;
struct ospf_iface_patt *ip=NULL;
+ struct nbma_node *nbma,*nb;
u8 i;
DBG("%s: If notify called\n", p->name);
@@ -323,7 +324,7 @@ ospf_if_notify(struct proto *p, unsigned flags, struct iface *iface)
for(i=0;i<8;i++) ifa->aukey[i]=0;
ifa->options=2; /* FIXME what options? */
- if(ip->type=OSPF_IT_UNDEF)
+ if(ip->type==OSPF_IT_UNDEF)
ifa->type=ospf_iface_clasify(ifa->iface, (struct proto *)ifa->proto);
else ifa->type=ip->type;
@@ -338,18 +339,26 @@ ospf_if_notify(struct proto *p, unsigned flags, struct iface *iface)
return;
}
ifa->dr_sk=NULL;
+ }
- if((ifa->ip_sk=ospf_open_ip_socket(ifa))==NULL)
- {
- log("%s: Huh? could not open ip socket on interface %s?", p->name,
- iface->name);
- mb_free(ifa);
- log("%s: Ignoring this interface", p->name);
- return;
- }
+ if((ifa->ip_sk=ospf_open_ip_socket(ifa))==NULL)
+ {
+ log("%s: Huh? could not open ip socket on interface %s?", p->name,
+ iface->name);
+ mb_free(ifa);
+ log("%s: Ignoring this interface", p->name);
+ return;
+ }
- init_list(&(ifa->neigh_list));
+ init_list(&ifa->neigh_list);
+ init_list(&ifa->nbma_list);
+ WALK_LIST(nb,ip->nbma_list)
+ {
+ nbma=mb_alloc(p->pool,sizeof(struct nbma_node));
+ nbma->ip=nb->ip;
+ add_tail(&ifa->nbma_list, NODE nbma);
}
+
/* Add hello timer */
ifa->hello_timer=tm_new(p->pool);
ifa->hello_timer->data=ifa;