Revision a1f5e514 sysdep/linux/netlink.c

View differences:

sysdep/linux/netlink.c
622 622

  
623 623
    nl_add_nexthop(h, bufsize, nh, af);
624 624

  
625
    if (nh->flags & RNF_ONLINK)
626
      rtnh->rtnh_flags |= RTNH_F_ONLINK;
627

  
625 628
    nl_close_nexthop(h, rtnh);
626 629
  }
627 630

  
......
660 663
      rv->next = NULL;
661 664
      last = &(rv->next);
662 665

  
666
      rv->flags = 0;
663 667
      rv->weight = nh->rtnh_hops;
664 668
      rv->iface = if_find_by_index(nh->rtnh_ifindex);
665 669
      if (!rv->iface)
......
672 676
	{
673 677
	  rv->gw = rta_get_ipa(a[RTA_GATEWAY]);
674 678

  
679
	  if (nh->rtnh_flags & RTNH_F_ONLINK)
680
	    rv->flags |= RNF_ONLINK;
681

  
675 682
	  neighbor *nbr;
676 683
	  nbr = neigh_find2(&p->p, &rv->gw, rv->iface,
677
			    (nh->rtnh_flags & RTNH_F_ONLINK) ? NEF_ONLINK : 0);
684
			    (rv->flags & RNF_ONLINK) ? NEF_ONLINK : 0);
678 685
	  if (!nbr || (nbr->scope == SCOPE_HOST))
679 686
	    return NULL;
680 687
	}
......
1228 1235
      {
1229 1236
	nl_add_attr_u32(&r->h, rsize, RTA_OIF, nh->iface->index);
1230 1237
	nl_add_nexthop(&r->h, rsize, nh, p->af);
1238

  
1239
	if (nh->flags & RNF_ONLINK)
1240
	  r->r.rtm_flags |= RTNH_F_ONLINK;
1231 1241
      }
1232 1242
      break;
1233 1243
    case RTD_BLACKHOLE:
......
1543 1553
	  if ((i->rtm_family == AF_INET6) && ipa_in_netX(ra->nh.gw, (net_addr *) &sit))
1544 1554
	    return;
1545 1555

  
1556
	  if (i->rtm_flags & RTNH_F_ONLINK)
1557
	    ra->nh.flags |= RNF_ONLINK;
1558

  
1546 1559
	  neighbor *nbr;
1547 1560
	  nbr = neigh_find2(&p->p, &(ra->nh.gw), ra->nh.iface,
1548
			    (i->rtm_flags & RTNH_F_ONLINK) ? NEF_ONLINK : 0);
1561
			    (ra->nh.flags & RNF_ONLINK) ? NEF_ONLINK : 0);
1549 1562
	  if (!nbr || (nbr->scope == SCOPE_HOST))
1550 1563
	    {
1551 1564
	      log(L_ERR "KRT: Received route %N with strange next-hop %I", net->n.addr,

Also available in: Unified diff