diff options
author | Ondrej Filip <feela@network.cz> | 2000-05-31 20:21:42 +0200 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2000-05-31 20:21:42 +0200 |
commit | 3728267827e83bc095956b16256feae9e28adce7 (patch) | |
tree | bbad2fefa17e506ace268d1098fa1690167aeea8 /proto/ospf/lsalib.c | |
parent | 31ee3d5f214666a4b2da328dc894a5a9089acc87 (diff) | |
download | bird-3728267827e83bc095956b16256feae9e28adce7.tar bird-3728267827e83bc095956b16256feae9e28adce7.zip |
And finally, Premature aging works. :-)
Diffstat (limited to 'proto/ospf/lsalib.c')
-rw-r--r-- | proto/ospf/lsalib.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/proto/ospf/lsalib.c b/proto/ospf/lsalib.c index 62ea0b8..d631712 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; |