summaryrefslogtreecommitdiff
path: root/proto/ospf/lsalib.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-05-31 18:21:42 +0000
committerOndrej Filip <feela@network.cz>2000-05-31 18:21:42 +0000
commit3728267827e83bc095956b16256feae9e28adce7 (patch)
treebbad2fefa17e506ace268d1098fa1690167aeea8 /proto/ospf/lsalib.c
parent31ee3d5f214666a4b2da328dc894a5a9089acc87 (diff)
And finally, Premature aging works. :-)
Diffstat (limited to 'proto/ospf/lsalib.c')
-rw-r--r--proto/ospf/lsalib.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/proto/ospf/lsalib.c b/proto/ospf/lsalib.c
index 62ea0b86..d6317125 100644
--- a/proto/ospf/lsalib.c
+++ b/proto/ospf/lsalib.c
@@ -349,8 +349,13 @@ int
lsa_comp(struct ospf_lsa_header *l1, struct ospf_lsa_header *l2)
/* Return codes from point of view of l1 */
{
- if(l1->sn>l2->sn) return CMP_NEWER;
- if(l1->sn<l2->sn) return CMP_OLDER;
+ u32 sn1,sn2;
+
+ sn1=l1->sn-LSA_INITSEQNO+1;
+ sn2=l2->sn-LSA_INITSEQNO+1;
+
+ if(sn1>sn2) return CMP_NEWER;
+ if(sn1<sn2) return CMP_OLDER;
if(l1->checksum=!l2->checksum)
return l1->checksum<l2->checksum ? CMP_OLDER : CMP_NEWER;