From 81119e86bdf47f41f06218f91e52024bc4d00e7c Mon Sep 17 00:00:00 2001 From: Juraj Sloboda Date: Fri, 25 May 2018 14:02:20 +0200 Subject: Implement DHCPv6 PD client (VPP-718, VPP-1050) Change-Id: I72a1ccdfdd5573335ef78fc01d5268934c73bd31 Signed-off-by: Juraj Sloboda --- src/vnet/ip/ip6_neighbor.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/vnet/ip/ip6_neighbor.c') diff --git a/src/vnet/ip/ip6_neighbor.c b/src/vnet/ip/ip6_neighbor.c index 3daea6bafbe..a76decf3431 100644 --- a/src/vnet/ip/ip6_neighbor.c +++ b/src/vnet/ip/ip6_neighbor.c @@ -236,6 +236,29 @@ static ip6_address_t ip6a_zero; /* ip6 address 0 */ static void wc_nd_signal_report (wc_nd_report_t * r); static void ra_signal_report (ra_report_t * r); +ip6_address_t +ip6_neighbor_get_link_local_address (u32 sw_if_index) +{ + static ip6_address_t empty_address = { {0} }; + ip6_neighbor_main_t *nm = &ip6_neighbor_main; + ip6_radv_t *radv_info; + u32 ri; + + ri = nm->if_radv_pool_index_by_sw_if_index[sw_if_index]; + if (ri == ~0) + { + clib_warning ("IPv6 is not enabled for sw_if_index %d", sw_if_index); + return empty_address; + } + radv_info = pool_elt_at_index (nm->if_radv_pool, ri); + if (radv_info == NULL) + { + clib_warning ("Internal error"); + return empty_address; + } + return radv_info->link_local_address; +} + /** * @brief publish wildcard arp event * @param sw_if_index The interface on which the ARP entires are acted -- cgit 1.2.3-korg