Revision 74c838a8 proto/ospf/topology.c

View differences:

proto/ospf/topology.c
513 513
  }
514 514
}
515 515

  
516

  
517
static inline u32
516
static u32
518 517
ort_to_lsaid(struct ospf_proto *p, ort *nf)
519 518
{
520 519
  /*
......
542 541
   * network appeared, we choose a different way.
543 542
   *
544 543
   * In OSPFv3, it is simpler. There is not a requirement for membership of the
545
   * result in the input network, so we just use a hash-based unique ID of a
546
   * routing table entry for a route that originated given LSA. For ext-LSA, it
547
   * is an imported route in the nest's routing table (p->table). For summary-LSA,
548
   * it is a 'source' route in the protocol internal routing table (p->rtf).
544
   * result in the input network, so we just allocate a unique ID from ID map
545
   * and store it in nf->lsa_id for further reference.
549 546
   */
550 547

  
551 548
  if (ospf_is_v3(p))
552
    return nf->fn.uid;
549
  {
550
    if (!nf->lsa_id)
551
      nf->lsa_id = idm_alloc(&p->idm);
552

  
553
    return nf->lsa_id;
554
  }
553 555

  
554 556
  net_addr_ip4 *net = (void *) nf->fn.addr;
555 557
  u32 id = ip4_to_u32(net->prefix);

Also available in: Unified diff