X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fip6-nd%2Fip6_nd_inline.h;h=c959c94ed1db6f747b78101df7ddaa9308789415;hb=ce1ff6a9b1ab2c4ab74165b26c92c2d551f53cf8;hp=5e8b9d6e4c05fee29d19db2d3c75f82d0759f790;hpb=f094ce7653917b8c331a79c088ef63ea2679c40d;p=vpp.git diff --git a/src/vnet/ip6-nd/ip6_nd_inline.h b/src/vnet/ip6-nd/ip6_nd_inline.h index 5e8b9d6e4c0..c959c94ed1d 100644 --- a/src/vnet/ip6-nd/ip6_nd_inline.h +++ b/src/vnet/ip6-nd/ip6_nd_inline.h @@ -23,6 +23,7 @@ #include #include #include +#include typedef enum { @@ -71,6 +72,13 @@ icmp6_send_neighbor_advertisement ( clib_host_to_net_u32 (ICMP6_NEIGHBOR_ADVERTISEMENT_FLAG_SOLICITED | ICMP6_NEIGHBOR_ADVERTISEMENT_FLAG_OVERRIDE); + /* if sending RAs is enabled, the "router" flag should be set, + * otherwise, neighbors may believe we have changed from a router + * to a host - RFC 4861 section 4.4 */ + if (ip6_ra_adv_enabled (sw_if_index0)) + icmp6_nsa->advertisement_flags |= + clib_host_to_net_u32 (ICMP6_NEIGHBOR_ADVERTISEMENT_FLAG_ROUTER); + icmp6_nsa->icmp.checksum = 0; icmp6_nsa->icmp.checksum = ip6_tcp_udp_icmp_compute_checksum (vm, b, ip6_h, &bogus_length);