Revision ef6f26b4

View differences:

proto/ospf/lsalib.c
340 340
lsa_comp(struct ospf_lsa_header *l1, struct ospf_lsa_header *l2)
341 341
			/* Return codes from point of view of l1 */
342 342
{
343
  if(l1->sn<l2->sn) return CMP_NEWER;
344
    if(l1->sn==l2->sn)
345
    {
346
      if(l1->checksum=!l2->checksum)
347
        return l1->checksum<l2->checksum ? CMP_OLDER : CMP_NEWER;
348
      if(l1->age==LSA_MAXAGE) return CMP_NEWER;
349
      if(l2->age==LSA_MAXAGE) return CMP_OLDER;
350
      if(abs(l1->age-l2->age)>LSA_MAXAGEDIFF)
351
        return l1->age<l2->age ? CMP_NEWER : CMP_OLDER;
352
    }
353
    return CMP_SAME;
343
  if(l1->sn>l2->sn) return CMP_NEWER;
344
  if(l1->sn<l2->sn) return CMP_OLDER;
345

  
346
  if(l1->checksum=!l2->checksum)
347
    return l1->checksum<l2->checksum ? CMP_OLDER : CMP_NEWER;
348

  
349
  if((l1->age==LSA_MAXAGE)&&(l2->age!=LSA_MAXAGE)) return CMP_NEWER;
350
  if((l2->age==LSA_MAXAGE)&&(l1->age!=LSA_MAXAGE)) return CMP_OLDER;
351

  
352
  if(abs(l1->age-l2->age)>LSA_MAXAGEDIFF)
353
    return l1->age<l2->age ? CMP_NEWER : CMP_OLDER;
354

  
355
  return CMP_SAME;
354 356
}
355 357

  
356 358
/* LSA can be temporarrily, but body must be mb_alloced. */

Also available in: Unified diff