summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/rde.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2005-10-12 09:51:59 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2005-10-12 09:51:59 +0000
commit04ad4a2c4512cbf0a81ab2a93c60ae92f1ad29bb (patch)
tree35b13cd962b82710f1df4aa5aa11d106b8dcd19c /usr.sbin/ospfd/rde.c
parent61a7992295b02cf6c14fb398a37382da67d92c0b (diff)
Fix the flooding procedure. Violate the RFC else many BAD_LS_REQ events and
session drops happend while booting up. If a router is conected to a other router over two different interface one session will be unable to load until the other one is in state FULL. ospfd no longer issues a BAD_LS_REQ event if the LSA is equal to the one in table but if the sent lsa is older a BAD_LS_REQ event is still issued. OK norby@
Diffstat (limited to 'usr.sbin/ospfd/rde.c')
-rw-r--r--usr.sbin/ospfd/rde.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/usr.sbin/ospfd/rde.c b/usr.sbin/ospfd/rde.c
index f538f41cde2..200d5fc3f13 100644
--- a/usr.sbin/ospfd/rde.c
+++ b/usr.sbin/ospfd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.29 2005/10/12 09:42:57 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.30 2005/10/12 09:51:58 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -402,20 +402,30 @@ rde_dispatch_imsg(int fd, short event, void *bula)
/* lsa not added so free it */
if (self)
free(lsa);
- } else if (rde_req_list_exists(nbr, &lsa->hdr)) {
- /* lsa no longer needed */
- free(lsa);
- imsg_compose(ibuf_ospfe, IMSG_LS_BADREQ,
- imsg.hdr.peerid, 0, -1, NULL, 0);
} else if (r < 0) {
/* lsa no longer needed */
free(lsa);
+ /*
+ * point 6 of "The Flooding Procedure"
+ * We are violating the RFC here because
+ * it does not make sense to reset a session
+ * because a equal LSA is already in the table.
+ * Only if the LSA sent is older than the one
+ * in the table we should reset the session.
+ */
+ if (rde_req_list_exists(nbr, &lsa->hdr)) {
+ imsg_compose(ibuf_ospfe, IMSG_LS_BADREQ,
+ imsg.hdr.peerid, 0, -1, NULL, 0);
+ break;
+ }
+
/* new LSA older than DB */
if (ntohl(db_hdr->seq_num) == MAX_SEQ_NUM &&
ntohs(db_hdr->age) == MAX_AGE)
/* seq-num wrap */
break;
+
if (v->changed + MIN_LS_ARRIVAL >= now)
break;