net: ip: sockaddr_ll_ptr is larger than sockaddr_in6_ptr

Make sure that the largest sockaddr_xx_ptr length is defined
last. Otherwise we might copy wrong amount of data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2020-06-14 12:42:34 +03:00 committed by Jukka Rissanen
parent 1a01aacd16
commit e6672f848a
1 changed files with 3 additions and 1 deletions

View File

@ -310,10 +310,12 @@ struct cmsghdr {
#if defined(CONFIG_NET_IPV6)
#undef NET_SOCKADDR_MAX_SIZE
#undef NET_SOCKADDR_PTR_MAX_SIZE
#define NET_SOCKADDR_MAX_SIZE (sizeof(struct sockaddr_in6))
#if !defined(CONFIG_NET_SOCKETS_PACKET)
#undef NET_SOCKADDR_PTR_MAX_SIZE
#define NET_SOCKADDR_PTR_MAX_SIZE (sizeof(struct sockaddr_in6_ptr))
#endif
#endif
#if !defined(CONFIG_NET_IPV4)
#if !defined(CONFIG_NET_IPV6)