+static void
+cp_ip6_advertise_prefix (prefix_info_t * prefix_info,
+ ip6_address_info_t * address_info, int enable)
+{
+ vlib_main_t *vm = vlib_get_main ();
+ ip6_main_t *im = &ip6_main;
+ u32 prefix_index;
+ ip6_address_t addr;
+ int rv;
+
+ prefix_index =
+ active_prefix_index_by_prefix_group_index_get
+ (address_info->prefix_group_index);
+
+ if (cp_ip6_construct_address (address_info, prefix_index, &addr) != 0)
+ {
+ clib_warning ("address construction FAIL");
+ return;
+ }
+
+ /* The RA code assumes that host bits are zero, so clear them */
+ addr.as_u64[0] &= im->fib_masks[address_info->prefix_length].as_u64[0];
+ addr.as_u64[1] &= im->fib_masks[address_info->prefix_length].as_u64[1];
+
+ rv = ip6_ra_prefix (vm, address_info->sw_if_index,
+ &addr, address_info->prefix_length,
+ 0 /* use_default */ ,
+ prefix_info->valid_lt,
+ prefix_info->preferred_lt, 0 /* no_advertise */ ,
+ 0 /* off_link */ ,
+ 0 /* no_autoconfig */ ,
+ 0 /* no_onlink */ ,
+ enable == 0 /* is_no */ );
+ if (rv != 0)
+ {
+ clib_warning ("ip6_neighbor_ra_prefix returned %d", rv);
+ return;
+ }
+
+ if (CLIB_DEBUG > 0)
+ clib_warning ("Advertise prefix %U valid lt %u preferred lt %u",
+ format_ip6_address_and_length, &addr,
+ address_info->prefix_length, prefix_info->valid_lt,
+ prefix_info->preferred_lt);
+}
+
+