net/icmpv6/icmpv6_radvertise.c: set the prefix length to preconfigured value

This commit is contained in:
Gregory Nutt 2017-11-08 07:50:36 -06:00
parent 795e884aea
commit d741185c91
1 changed files with 2 additions and 1 deletions

View File

@ -226,11 +226,12 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev)
#ifdef CONFIG_NET_ICMPv6_ROUTER_MANUAL
/* Copy the configured prefex */
prefix->preflen = CONFIG_NET_ICMPv6_PREFLEN;
net_ipv6addr_copy(prefix->prefix, g_ipv6_prefix);
#else
/* Set the prefix and prefix length based on net driver IP and netmask */
prefix->preflen = net_ipv6_mask2pref(dev->d_ipv6netmask);
prefix->preflen = net_ipv6_mask2pref(dev->d_ipv6netmask);
ipv6addr_mask(prefix->prefix, dev->d_ipv6addr, dev->d_ipv6netmask);
#endif /* CONFIG_NET_ICMPv6_ROUTER_MANUAL */