diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-02-01 12:46:55 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-02-01 12:46:55 +0000 |
commit | b16df421e514104e266b667dda80ed27a7582a3a (patch) | |
tree | 594e5f40b8930d8c4cc90787a11486ed6afcd083 /usr.sbin/ospfd | |
parent | a9bd4da40a75e3c21db269249271e57eb8736276 (diff) |
There is no need to check if the LSA is matched by an net LSA in
rde_asext_put(). Just try to remove the as-ext LSA, if the prefix is
announced as stub net LSA lsa_find() will fail later and nothing will
happen. OK norby@ pyr@
Diffstat (limited to 'usr.sbin/ospfd')
-rw-r--r-- | usr.sbin/ospfd/rde.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/usr.sbin/ospfd/rde.c b/usr.sbin/ospfd/rde.c index 3993cc6ddb5..d7da6807d9b 100644 --- a/usr.sbin/ospfd/rde.c +++ b/usr.sbin/ospfd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.55 2007/01/29 13:04:13 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.56 2007/02/01 12:46:54 claudio Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -631,7 +631,12 @@ rde_dispatch_parent(int fd, short event, void *bula) v = lsa_find(NULL, lsa->hdr.type, lsa->hdr.ls_id, lsa->hdr.adv_rtr); - lsa_merge(nbrself, lsa, v); + /* + * if v == NULL no LSA is in the table and + * nothing has to be done. + */ + if (v) + lsa_merge(nbrself, lsa, v); } break; case IMSG_KROUTE_GET: @@ -970,20 +975,10 @@ rde_asext_get(struct rroute *rr) struct lsa * rde_asext_put(struct rroute *rr) { - struct area *area; - struct iface *iface; - - LIST_FOREACH(area, &rdeconf->area_list, entry) - LIST_FOREACH(iface, &area->iface_list, entry) { - if ((iface->addr.s_addr & iface->mask.s_addr) == - rr->kr.prefix.s_addr && iface->mask.s_addr == - prefixlen2mask(rr->kr.prefixlen)) { - /* already announced as (stub) net LSA */ - log_debug("rde_asext_put: %s/%d is net LSA", - inet_ntoa(rr->kr.prefix), rr->kr.prefixlen); - return (NULL); - } - } + /* + * just try to remove the LSA. If the prefix is announced as + * stub net LSA lsa_find() will fail later and nothing will happen. + */ /* remove by reflooding with MAX_AGE */ return (orig_asext_lsa(rr, MAX_AGE)); |