- *(o+40) = 134; // RA message
- *(o+41) = 0; // Code
- *(o+42) = *(o+43) = 0; // Checksum
- *(o+44) = 64; // Hop count
- *(o+45) = 0; // Flags
- *(o+46) = *(o+47) = 255; // Lifetime
- *(uint32_t *)(o+48) = 0; // Reachable time
- *(uint32_t *)(o+52) = 0; // Retrans timer
- pinfo = (struct nd_opt_prefix_info *)(o+56);
+
+ // RA message after Ipv6 header
+ p_nra = (struct nd_router_advert *) &p_ip6_hdr[1];
+ p_nra->nd_ra_type = ND_ROUTER_ADVERT; // RA message (134)
+ p_nra->nd_ra_code = 0; // Code
+ p_nra->nd_ra_cksum = 0; // Checksum
+ p_nra->nd_ra_curhoplimit = 64; // Hop count
+ p_nra->nd_ra_flags_reserved = (ND_RA_FLAG_MANAGED|ND_RA_FLAG_OTHER); // Flags
+ p_nra->nd_ra_router_lifetime = 0xFFFF; // Lifetime
+ p_nra->nd_ra_reachable = 0; // Reachable time
+ p_nra->nd_ra_retransmit = 0; // Retrans timer
+ // Option PI after RA message (rfc4861)
+ pinfo = (struct nd_opt_prefix_info *) &p_nra[1];