Revision dab66519

View differences:

proto/ospf/lsalib.c
39 39
       lsasum_calculate(&en->lsa,en->lsa_body,po);
40 40
       return;
41 41
    }
42
    if((en->lsa.age+=delta)>LSA_MAXAGE)
42
    if((en->lsa.age+=delta)>=LSA_MAXAGE)
43 43
    {
44
      if(flush) flush_lsa(en,oa);
44
      if(flush)
45
      {
46
        flush_lsa(en,oa);
47
        schedule_rtcalc(oa);
48
      }
45 49
      else en->lsa.age=LSA_MAXAGE;
46 50
    }
47 51
  }
......
364 368
  if((l1->age==LSA_MAXAGE)&&(l2->age!=LSA_MAXAGE)) return CMP_NEWER;
365 369
  if((l2->age==LSA_MAXAGE)&&(l1->age!=LSA_MAXAGE)) return CMP_OLDER;
366 370

  
371
  debug("Abs=%u\n",abs(l1->age-l2->age));
367 372
  if(abs(l1->age-l2->age)>LSA_MAXAGEDIFF)
368 373
    return l1->age<l2->age ? CMP_NEWER : CMP_OLDER;
369 374

  
......
379 384
  unsigned i;
380 385
  struct top_hash_entry *en;
381 386

  
387
  if(body==NULL) die("AA");
388

  
382 389
  if((en=ospf_hash_find_header(oa->gr,lsa))==NULL)
383 390
  {
384 391
    en=ospf_hash_get_header(oa->gr,lsa);
......
403 410
    if(change) s_rem_node(SNODE en);
404 411
  }
405 412

  
413
  s_add_tail(&oa->lsal, SNODE en);
414
  en->inst_t=now;
415
  if(en->lsa_body!=NULL) mb_free(en->lsa_body);
416
  en->lsa_body=body;
417
  memcpy(&en->lsa,lsa,sizeof(struct ospf_lsa_header));
418

  
406 419
  if(change)
407 420
  {
408
    s_add_tail(&oa->lsal, SNODE en);
409
    en->inst_t=now;
410
    if(en->lsa_body!=NULL) mb_free(en->lsa_body);
411
    en->lsa_body=body;
412
    memcpy(&en->lsa,lsa,sizeof(struct ospf_lsa_header));
413
    /* FIXME decide if route calculation must be done and how */
414
    if(oa->rt!=NULL)
415
    {
416
      schedule_rtcalc(oa);
417
    }
421
    schedule_rtcalc(oa);
418 422
  }
419 423
  
420 424
  return en;

Also available in: Unified diff