net: ip: Verify that in_addr/in6_addr struct sizes are correct
Make sure that in_addr/in6_addr structure size match the respective binary IP address size with BUILD_ASSERT. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
984ebd519a
commit
0da228c57c
3 changed files with 10 additions and 0 deletions
|
@ -144,6 +144,9 @@ struct in6_addr {
|
|||
};
|
||||
};
|
||||
|
||||
/* Binary size of the IPv6 address */
|
||||
#define NET_IPV6_ADDR_SIZE 16
|
||||
|
||||
/** IPv4 address struct */
|
||||
struct in_addr {
|
||||
union {
|
||||
|
@ -154,6 +157,9 @@ struct in_addr {
|
|||
};
|
||||
};
|
||||
|
||||
/* Binary size of the IPv4 address */
|
||||
#define NET_IPV4_ADDR_SIZE 4
|
||||
|
||||
/** Socket address family type */
|
||||
typedef unsigned short int sa_family_t;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue