diff options
author | Joakim Tjernlund <Joakim.Tjernlund@transmode.se> | 2008-08-20 14:24:39 +0200 |
---|---|---|
committer | Joakim Tjernlund <Joakim.Tjernlund@transmode.se> | 2008-08-25 09:50:17 +0200 |
commit | 910e2704bee6bf78aee858db65f5393be618e683 (patch) | |
tree | 881c792fa2424d34c485e23b368a57c9c6a6daaa | |
parent | b38309a4ee831a440ef78f8a27db584f2f8e8276 (diff) |
Ignore host routes to self.
PtP links with /32 masks adds host routes to the remote host,
see RFC 2328, 12.4.1.1, Option 1.
Make sure that such routes are ignored
-rw-r--r-- | ospfd/ospf_spf.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c index 23d45dd6..15d27be7 100644 --- a/ospfd/ospf_spf.c +++ b/ospfd/ospf_spf.c @@ -981,7 +981,21 @@ ospf_spf_process_stubs (struct ospf_area *area, struct vertex *v, (l->m[0].tos_count * ROUTER_LSA_TOS_SIZE)); if (l->m[0].type == LSA_LINK_TYPE_STUB) - ospf_intra_add_stub (rt, l, v, area); + { + /* PtP links with /32 masks adds host routes to the remote host, + see RFC 2328, 12.4.1.1, Option 1. + Make sure that such routes are ignored */ + /* XXX: Change to breadth-first and avoid the lookup */ + if (l->link_data.s_addr == 0xffffffff && + ospf_if_lookup_by_local_addr (area->ospf, NULL, l->link_id)) + { + if (IS_DEBUG_OSPF_EVENT) + zlog_debug ("ospf_spf_process_stubs(): ignoring host route " + "%s/32 to self.", inet_ntoa (l->link_id)); + continue; + } + ospf_intra_add_stub (rt, l, v, area); + } } } |