summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Jakma <paul@jakma.org>2009-08-03 13:47:25 +0000
committerDavid Lamparter <equinox@diac24.net>2010-02-04 02:03:42 +0100
commit2f9994561e1a6547f9e55d41da85f755c97553f4 (patch)
tree163aef7b480f16c302168355c290df6d5fa3ed90
parent64c87944ec8799443c62ca144046abf5788e8216 (diff)
downloadquagga-2f9994561e1a6547f9e55d41da85f755c97553f4.tar.bz2
quagga-2f9994561e1a6547f9e55d41da85f755c97553f4.tar.xz
ospfd: External routes over PtoP must be directly connected.
On Fri, 31 Jul 2009, Joakim Tjernlund wrote: > How can I do that? ASE is screwing with the P2P route and needs > some fixing. Perhaps you are suggesting to remove the check in ase > all togher(delete the whole for loop) and place it somewhere else? > I haven't looked at that possiblity and I am not convinced that it > is a good idea either. Well, what I'm curious about is how you don't see a similar issue with non-AS-external routes? Indeed, I wonder why we can't just apply your check much earlier - as/when we add routes to the intra-area routing table - and just get rid of that complete_direct_routes thing altogether. > ASE is forcing a nexthop.s_addr when it should not. So would this perhaps fix it too (and if so, possibly fix similar issues with other kinds of routes too)?: REPLACES "External routes over PtoP must be directly connected." by Joakim Tjernlund As all locally routes over PtoP interfaces are interface routes, one must also make sure that external routes over PtoP interfaces are directly connected. Cc: David Lamparter <equinox@diac24.net>
-rw-r--r--ospfd/ospf_ase.c27
-rw-r--r--ospfd/ospf_route.c12
2 files changed, 14 insertions, 25 deletions
diff --git a/ospfd/ospf_ase.c b/ospfd/ospf_ase.c
index 5d0cae42..d3873561 100644
--- a/ospfd/ospf_ase.c
+++ b/ospfd/ospf_ase.c
@@ -130,18 +130,6 @@ ospf_find_asbr_route_through_area (struct route_table *rtrs,
return NULL;
}
-static void
-ospf_ase_complete_direct_routes (struct ospf_route *ro, struct in_addr nexthop)
-{
- struct listnode *node;
- struct ospf_path *op;
- struct interface *ifp;
-
- for (ALL_LIST_ELEMENTS_RO (ro->paths, node, op))
- if (op->nexthop.s_addr == 0)
- op->nexthop.s_addr = nexthop.s_addr;
-}
-
static int
ospf_ase_forward_address_check (struct ospf *ospf, struct in_addr fwd_addr)
{
@@ -451,8 +439,8 @@ ospf_ase_calculate_route (struct ospf *ospf, struct ospf_lsa * lsa)
/* if there is a Intra/Inter area route to the N
do not install external route */
- if (rn = route_node_lookup (ospf->new_table,
- (struct prefix *) &p))
+ if ((rn = route_node_lookup (ospf->new_table,
+ (struct prefix *) &p)))
{
route_unlock_node(rn);
if (rn->info == NULL)
@@ -463,8 +451,8 @@ ospf_ase_calculate_route (struct ospf *ospf, struct ospf_lsa * lsa)
}
/* Find a route to the same dest */
/* If there is no route, create new one. */
- if (rn = route_node_lookup (ospf->new_external_route,
- (struct prefix *) &p))
+ if ((rn = route_node_lookup (ospf->new_external_route,
+ (struct prefix *) &p)))
route_unlock_node(rn);
if (!rn || (or = rn->info) == NULL)
@@ -475,8 +463,6 @@ ospf_ase_calculate_route (struct ospf *ospf, struct ospf_lsa * lsa)
ospf_route_add (ospf->new_external_route, &p, new, asbr_route);
- if (al->e[0].fwd_addr.s_addr)
- ospf_ase_complete_direct_routes (new, al->e[0].fwd_addr);
return 0;
}
else
@@ -513,8 +499,7 @@ ospf_ase_calculate_route (struct ospf *ospf, struct ospf_lsa * lsa)
if (IS_DEBUG_OSPF (lsa, LSA))
zlog_debug ("Route[External]: New route is better");
ospf_route_subst (rn, new, asbr_route);
- if (al->e[0].fwd_addr.s_addr)
- ospf_ase_complete_direct_routes (new, al->e[0].fwd_addr);
+
or = new;
new = NULL;
}
@@ -531,8 +516,6 @@ ospf_ase_calculate_route (struct ospf *ospf, struct ospf_lsa * lsa)
if (IS_DEBUG_OSPF (lsa, LSA))
zlog_debug ("Route[External]: Routes are equal");
ospf_route_copy_nexthops (or, asbr_route->paths);
- if (al->e[0].fwd_addr.s_addr)
- ospf_ase_complete_direct_routes (or, al->e[0].fwd_addr);
}
}
/* Make sure setting newly calculated ASBR route.*/
diff --git a/ospfd/ospf_route.c b/ospfd/ospf_route.c
index 267237b8..2a81e97a 100644
--- a/ospfd/ospf_route.c
+++ b/ospfd/ospf_route.c
@@ -810,12 +810,18 @@ ospf_route_copy_nexthops_from_vertex (struct ospf_route *to,
{
nexthop = vp->nexthop;
- if (nexthop->oi != NULL)
+ if (nexthop->oi != NULL)
{
- if (! ospf_path_exist (to->paths, nexthop->router, nexthop->oi))
+ if (!ospf_path_exist (to->paths, nexthop->router, nexthop->oi))
{
path = ospf_path_new ();
- path->nexthop = nexthop->router;
+
+ /* PtoP I/F's are always directly connected */
+ if (if_is_pointopoint (nexthop->oi->ifp))
+ path->nexthop.s_addr = INADDR_ANY;
+ else
+ path->nexthop = nexthop->router;
+
path->ifindex = nexthop->oi->ifp->ifindex;
listnode_add (to->paths, path);
}