Revision ccee67ca

View differences:

proto/bgp/bgp.c
1504 1504
      c->next_hop_addr = src;
1505 1505
  }
1506 1506

  
1507
  /* Use preferred addresses associated with interface / source address */
1508
  if (ipa_zero(c->next_hop_addr))
1509
  {
1510
    /* We know the iface for single-hop, we make lookup for multihop */
1511
    struct neighbor *nbr = p->neigh ?: neigh_find2(&p->p, &src, NULL, 0);
1512
    struct iface *iface = nbr ? nbr->iface : NULL;
1513

  
1514
    if (bgp_channel_is_ipv4(c) && iface && iface->addr4)
1515
      c->next_hop_addr = iface->addr4->ip;
1516

  
1517
    if (bgp_channel_is_ipv6(c) && iface && iface->addr6)
1518
      c->next_hop_addr = iface->addr6->ip;
1519
  }
1520

  
1507 1521
  /* Exit if no feasible next hop address is found */
1508 1522
  if (ipa_zero(c->next_hop_addr))
1509 1523
  {
......
2079 2093
    {
2080 2094
      channel_show_info(&c->c);
2081 2095

  
2096
      if (ipa_zero(c->link_addr))
2097
	cli_msg(-1006, "    BGP Next hop:   %I", c->next_hop_addr);
2098
      else
2099
	cli_msg(-1006, "    BGP Next hop:   %I %I", c->next_hop_addr, c->link_addr);
2100

  
2082 2101
      if (c->igp_table_ip4)
2083 2102
	cli_msg(-1006, "    IGP IPv4 table: %s", c->igp_table_ip4->name);
2084 2103

  

Also available in: Unified diff