summaryrefslogtreecommitdiffstats
path: root/proto/ospf/topology.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-05-31 15:20:25 +0200
committerOndrej Filip <feela@network.cz>2000-05-31 15:20:25 +0200
commitfc741dab27913b9c5f9a97642158b5011a9c4700 (patch)
tree48abbd10ee404923c805859bd7618eacb05ed0b7 /proto/ospf/topology.c
parente0bbb7b7ef1aabbf037190225ebac11f7812ae84 (diff)
downloadbird-fc741dab27913b9c5f9a97642158b5011a9c4700.tar
bird-fc741dab27913b9c5f9a97642158b5011a9c4700.zip
Handle better next hop in external LSA.
Diffstat (limited to 'proto/ospf/topology.c')
-rw-r--r--proto/ospf/topology.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/proto/ospf/topology.c b/proto/ospf/topology.c
index bb3cb06..cf08ed7 100644
--- a/proto/ospf/topology.c
+++ b/proto/ospf/topology.c
@@ -329,6 +329,7 @@ originate_ext_lsa_body(net *n, rte *e, struct proto_ospf *po, struct ea_list *at
u32 m1 = ea_get_int(attrs, EA_OSPF_METRIC1, 0);
u32 m2 = ea_get_int(attrs, EA_OSPF_METRIC2, 0);
u32 tag = ea_get_int(attrs, EA_OSPF_TAG, 0);
+ int inas=0;
ext=mb_alloc(p->pool,sizeof(struct ospf_lsa_ext)+
sizeof(struct ospf_lsa_ext_tos));
@@ -348,7 +349,12 @@ originate_ext_lsa_body(net *n, rte *e, struct proto_ospf *po, struct ea_list *at
}
et->padding=0;
et->tag=tag;
- if(1) et->fwaddr= ipa_from_u32(0); /* FIXME if e->attrs->iface is not in my AS*/
+ if(ipa_compare(e->attrs->gw,ipa_from_u32(0))!=0)
+ {
+ if(find_iface((struct proto_ospf *)p, e->attrs->iface)!=NULL) inas=1;
+ }
+
+ if(!inas) et->fwaddr= ipa_from_u32(0);
else et->fwaddr=e->attrs->gw;
return ext;
}