diff options
Diffstat (limited to 'usr.sbin/ospfd/rde_lsdb.c')
-rw-r--r-- | usr.sbin/ospfd/rde_lsdb.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/usr.sbin/ospfd/rde_lsdb.c b/usr.sbin/ospfd/rde_lsdb.c index f5686a35d43..5239f7b2cac 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.14 2005/05/24 06:55:21 claudio Exp $ */ +/* $OpenBSD: rde_lsdb.c,v 1.15 2005/05/24 07:13:00 claudio Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -578,10 +578,18 @@ lsa_merge(struct rde_nbr *nbr, struct lsa *lsa, struct vertex *v) return; } - /* TODO check for changes */ - - /* set the seq_num to the current on. lsa_refresh() will do the ++ */ + /* set the seq_num to the current one. lsa_refresh() will do the ++ */ lsa->hdr.seq_num = v->lsa->hdr.seq_num; + + /* compare LSA most header fields are equal so don't check them */ + if (lsa->hdr.len == v->lsa->hdr.len && + lsa->hdr.opts == v->lsa->hdr.opts && + memcmp(&lsa->data, &v->lsa->data, ntohs(lsa->hdr.len) - + sizeof(struct lsa_hdr)) == 0) { + free(lsa); + return; + } + /* overwrite the lsa all other fields are unaffected */ free(v->lsa); v->lsa = lsa; |