Revision e8ab1680 proto/ospf/rt.c

View differences:

proto/ospf/rt.c
235 235
        a0.flags=0;
236 236
        a0.aflags=0;
237 237
        a0.iface=en->nhi;
238
        a0.gw=en->nh;
238
        if(ipa_in_net(en->nh,en->nhi->addr->ip,en->nhi->addr->pxlen))
239
        {
240
           a0.gw=IPA_NONE;
241
        }
242
        else
243
        {
244
           a0.gw=en->nh;
245
        }
246
        
239 247
        ne=net_get(p->table, nf->fn.prefix, nf->fn.pxlen);
240 248
        e=rte_get_temp(&a0);
241 249
        e->u.ospf.metric1=nf->metric;
......
604 612
  u32 myrid=p->cf->global->router_id;
605 613

  
606 614
  DBG("     Next hop called.\n");
607
  if(ipa_to_u32(par->nh)==0)
615
  if(ipa_equal(par->nh,IPA_NONE))
608 616
  {
609 617
    neighbor *nn;
610 618
    DBG("     Next hop calculating for id: %I rt: %I type: %u\n",
611 619
      en->lsa.id,en->lsa.rt,en->lsa.type);
612 620

  
613
/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
614 621
    if(par==oa->rt)
615 622
    {
616 623
      if(en->lsa.type==LSA_T_NET)
......
637 644
      {
638 645
        if((neigh=find_neigh_noifa(po,en->lsa.rt))==NULL) return;
639 646
        en->nhi=neigh->ifa->iface;
647
        en->nh=neigh->ip;	/* Yes, neighbor is it's own next hop */
640 648
        return;
641 649
      }
642 650
    }
......
651 659
    else	/* Parent is some RT neighbor */
652 660
    {
653 661
      /* FIXME: I should probably hold ospf_iface in top_hash_entry */
662
      /* FIXME: Isn't this useless */
654 663
      neigh=NULL;
655 664
      WALK_LIST(ifa,po->iface_list)
656 665
      {

Also available in: Unified diff