summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2005-10-12 09:08:26 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2005-10-12 09:08:26 +0000
commitc6ebafae316b5aba91d4dc7864724d9446dfef2c (patch)
tree1911ae974a9d170ded3a8bea5dd84bac26d11504 /usr.sbin/ospfd
parentfeb09f6dffc3e0e68f2a0a1d3c894ce5c3f38d6a (diff)
In one special condition ospfd sent out ls updates without updating the
checksum. Because of the invalid checksum the other routers dropped it and so the update was retransmitted over and over again. Now we update the checksum in lsa_merge() after bumping the sequence number instead of hoping that lsa_timeout() -> lsa_refresh() will do it for us. OK norby@
Diffstat (limited to 'usr.sbin/ospfd')
-rw-r--r--usr.sbin/ospfd/rde_lsdb.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/ospfd/rde_lsdb.c b/usr.sbin/ospfd/rde_lsdb.c
index 6b63afd5cbf..08b806b880c 100644
--- a/usr.sbin/ospfd/rde_lsdb.c
+++ b/usr.sbin/ospfd/rde_lsdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_lsdb.c,v 1.20 2005/10/06 17:06:44 claudio Exp $ */
+/* $OpenBSD: rde_lsdb.c,v 1.21 2005/10/12 09:08:25 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -578,6 +578,7 @@ lsa_merge(struct rde_nbr *nbr, struct lsa *lsa, struct vertex *v)
{
struct timeval tv;
time_t now;
+ u_int16_t len;
if (v == NULL) {
lsa_add(nbr, lsa);
@@ -588,6 +589,10 @@ lsa_merge(struct rde_nbr *nbr, struct lsa *lsa, struct vertex *v)
/* set the seq_num to the current one. lsa_refresh() will do the ++ */
lsa->hdr.seq_num = v->lsa->hdr.seq_num;
+ /* recalculate checksum */
+ len = ntohs(lsa->hdr.len);
+ lsa->hdr.ls_chksum = 0;
+ lsa->hdr.ls_chksum = htons(iso_cksum(lsa, len, LS_CKSUM_OFFSET));
/* compare LSA most header fields are equal so don't check them */
if (lsa_equal(lsa, v->lsa)) {