net: ip: Fix IPv6 RS message doesn't comply RFC4291
Current implementation of net_ipv6_send_rs() uses net_ipv6_addr_create_ll_allnodes_mcast() for creating RS packet. As result we send RS packet to all-nodes destination [FF02::1], but RFC4291 requires all-routers destination [FF02::2] for RS packets. Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com>
This commit is contained in:
parent
a3621cecd5
commit
ad59e7fec5
|
@ -1055,6 +1055,16 @@ static inline void net_ipv6_addr_create_ll_allnodes_mcast(struct in6_addr *addr)
|
|||
net_ipv6_addr_create(addr, 0xff02, 0, 0, 0, 0, 0, 0, 0x0001);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Create link local allrouters multicast IPv6 address
|
||||
*
|
||||
* @param addr IPv6 address
|
||||
*/
|
||||
static inline void net_ipv6_addr_create_ll_allrouters_mcast(struct in6_addr *addr)
|
||||
{
|
||||
net_ipv6_addr_create(addr, 0xff02, 0, 0, 0, 0, 0, 0, 0x0002);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Create IPv6 address interface identifier
|
||||
*
|
||||
|
|
|
@ -1968,7 +1968,7 @@ int net_ipv6_send_rs(struct net_if *iface)
|
|||
struct in6_addr dst;
|
||||
struct net_pkt *pkt;
|
||||
|
||||
net_ipv6_addr_create_ll_allnodes_mcast(&dst);
|
||||
net_ipv6_addr_create_ll_allrouters_mcast(&dst);
|
||||
src = net_if_ipv6_select_src_addr(iface, &dst);
|
||||
|
||||
if (!net_ipv6_is_addr_unspecified(src)) {
|
||||
|
|
Loading…
Reference in a new issue