diff options
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; |