-/* $OpenBSD: rde_lsdb.c,v 1.43 2009/11/12 22:29:15 claudio Exp $ */
+/* $OpenBSD: rde_lsdb.c,v 1.44 2010/07/19 09:11:08 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
u_int16_t len;
/* refresh LSA by increasing sequence number by one */
- v->lsa->hdr.age = htons(DEFAULT_AGE);
+ if (v->self && ntohs(v->lsa->hdr.age) >= MAX_AGE)
+ /* self originated network that is currently beeing removed */
+ v->lsa->hdr.age = htons(MAX_AGE);
+ else
+ v->lsa->hdr.age = htons(DEFAULT_AGE);
seqnum = ntohl(v->lsa->hdr.seq_num);
if (seqnum++ == MAX_SEQ_NUM)
/* XXX fix me */
return (0);
if (a->hdr.opts != b->hdr.opts)
return (0);
- /* LSA with age MAX_AGE are never equal */
+ /* LSAs with age MAX_AGE are never equal */
if (a->hdr.age == htons(MAX_AGE) || b->hdr.age == htons(MAX_AGE))
return (0);
if (memcmp(&a->data, &b->data, ntohs(a->hdr.len) -