summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2005-04-06 09:27:29 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2005-04-06 09:27:29 +0000
commit67aafc3e3b5850abcb2f764172f5555d3300e3f1 (patch)
tree9d4ef0872401e3bed2e55b80bf85c4480ad4fc4a
parentff9b47c33ca81ae0aa71c444119bd9b0a2725138 (diff)
When deleting LSA because they hit max age (IMSG_LS_MAXAGE) check if the
current LSA in the database was updated while max age LSA was flooded out. This solves a reace condition where self originated LSA got removed because an other server sent an update with age set to MAXAGE. OK norby@
-rw-r--r--usr.sbin/ospfd/rde.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/usr.sbin/ospfd/rde.c b/usr.sbin/ospfd/rde.c
index 7f532d86366..acbff688b2d 100644
--- a/usr.sbin/ospfd/rde.c
+++ b/usr.sbin/ospfd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.10 2005/03/14 18:21:29 norby Exp $ */
+/* $OpenBSD: rde.c,v 1.11 2005/04/06 09:27:28 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -427,7 +427,18 @@ rde_dispatch_imsg(int fd, short event, void *bula)
if (rde_nbr_loading(nbr->area))
break;
- lsa_del(nbr, &lsa_hdr);
+ v = lsa_find(nbr->area, lsa_hdr.type, lsa_hdr.ls_id,
+ lsa_hdr.adv_rtr);
+ if (v == NULL)
+ db_hdr = NULL;
+ else
+ db_hdr = &v->lsa->hdr;
+
+ /*
+ * only delete LSA if the one in the db is not newer
+ */
+ if (lsa_newer(db_hdr, &lsa_hdr) <= 0)
+ lsa_del(nbr, &lsa_hdr);
break;
case IMSG_CTL_SHOW_DATABASE:
if (imsg.hdr.len != IMSG_HEADER_SIZE &&