- loc_indexp = vec_elt_at_index(loc_set->locator_indices, i);
- loc = pool_elt_at_index (lcm->locator_pool, loc_indexp[0]);
-
- /* Add ipv4 locators first TODO sort them */
- foreach_ip_interface_address (&lcm->im4->lookup_main, ia,
- loc->sw_if_index, 1 /* unnumbered */,
- ({
- l4 = ip_interface_address_get_address (&lcm->im4->lookup_main, ia);
- p = vlib_buffer_put_uninit (b, ip4_address_size_to_put());
- ip4_address_put (p, l4);
- count++;
- }));
-
- /* Add ipv6 locators */
- foreach_ip_interface_address (&lcm->im6->lookup_main, ia,
- loc->sw_if_index, 1 /* unnumbered */,
- ({
- l6 = ip_interface_address_get_address (&lcm->im6->lookup_main, ia);
- p = vlib_buffer_put_uninit (b, ip6_address_size_to_put());
- ip6_address_put (p, l6);
- count++;
- }));
+ case IP4:
+ p = vlib_buffer_put_uninit (b, ip4_address_size_to_put());
+ ip4_address_put (p, &ip_addr_v4(addr));
+ count++;
+ break;
+ case IP6:
+ p = vlib_buffer_put_uninit (b, ip6_address_size_to_put());
+ ip6_address_put (p, &ip_addr_v6(addr));
+ count++;
+ break;