Re: [ris-int] how to get the next hop from ris raw data

Yes. The two next-hops are the BGP next-hop and the link-local next-hop, as specified by RFC 2545 section 3:
The value of the Length of Next Hop Network Address field on a MP_REACH_NLRI attribute shall be set to 16, when only a global address is present, or 32 if a link-local address is also included in the Next Hop field.
The link-local address shall be included in the Next Hop field if and only if the BGP speaker shares a common subnet with the entity identified by the global IPv6 address carried in the Network Address of Next Hop field and the peer the route is being advertised to.
ok, got that, thanks! But next question is how this applies to IPv4. The bgpdump.c code features same constructs for AFI_IP and AFI_IP6. e.g. printf("(IPv4 Unicast)\n"); printf("NEXT_HOP: %s\n",inet_ntoa(attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->nexthop.v4_addr)); if (attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->nexthop_len==32) printf("NEXT_HOP: %s\n",inet_ntoa(attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->nexthop_local.v4_addr)); is it ever possible to get nexthop_len==32 in this case ??? or did the authors of bgpdump.c just liked typing? :) Cheers, -- Rene

Rene Wilhelm wrote:
But next question is how this applies to IPv4. The bgpdump.c code features same constructs for AFI_IP and AFI_IP6.
e.g.
printf("(IPv4 Unicast)\n"); printf("NEXT_HOP: %s\n",inet_ntoa(attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->nexthop.v4_addr)); if (attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->nexthop_len==32) printf("NEXT_HOP: %s\n",inet_ntoa(attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->nexthop_local.v4_addr));
is it ever possible to get nexthop_len==32 in this case ??? or did the authors of bgpdump.c just liked typing? :)
I think the authors of bgpdump.c just liked cut and paste :-) Hello from sunny California! Cheers, Lorenzo -- Lorenzo Colitti http://www.colitti.com/lorenzo/
participants (2)
-
Lorenzo Colitti
-
Rene Wilhelm