mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 01:31:55 +00:00
Lib: Ensure that all net_addr structures have the same alignment
Also weaken the explicit alignment of net_addr to be u32, as VPN is already u32-aligned.
This commit is contained in:
parent
34b7d77e06
commit
161aef353a
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include "lib/alloca.h"
|
#include "lib/alloca.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stdalign.h>
|
||||||
|
|
||||||
/* Ugly structure offset handling macros */
|
/* Ugly structure offset handling macros */
|
||||||
|
|
||||||
|
15
lib/net.c
15
lib/net.c
@ -75,6 +75,21 @@ STATIC_ASSERT(sizeof(net_addr_ip6_sadr) == 40);
|
|||||||
STATIC_ASSERT(sizeof(net_addr_mpls) == 8);
|
STATIC_ASSERT(sizeof(net_addr_mpls) == 8);
|
||||||
STATIC_ASSERT(sizeof(net_addr_aspa) == 8);
|
STATIC_ASSERT(sizeof(net_addr_aspa) == 8);
|
||||||
|
|
||||||
|
/* Ensure that all net_addr structures have the same alignment */
|
||||||
|
STATIC_ASSERT(alignof(net_addr_ip4) == alignof(net_addr));
|
||||||
|
STATIC_ASSERT(alignof(net_addr_ip6) == alignof(net_addr));
|
||||||
|
STATIC_ASSERT(alignof(net_addr_vpn4) == alignof(net_addr));
|
||||||
|
STATIC_ASSERT(alignof(net_addr_vpn6) == alignof(net_addr));
|
||||||
|
STATIC_ASSERT(alignof(net_addr_roa4) == alignof(net_addr));
|
||||||
|
STATIC_ASSERT(alignof(net_addr_roa6) == alignof(net_addr));
|
||||||
|
STATIC_ASSERT(alignof(net_addr_flow4) == alignof(net_addr));
|
||||||
|
STATIC_ASSERT(alignof(net_addr_flow6) == alignof(net_addr));
|
||||||
|
STATIC_ASSERT(alignof(net_addr_flow4) == alignof(net_addr));
|
||||||
|
STATIC_ASSERT(alignof(net_addr_flow6) == alignof(net_addr));
|
||||||
|
STATIC_ASSERT(alignof(net_addr_ip6_sadr) == alignof(net_addr));
|
||||||
|
STATIC_ASSERT(alignof(net_addr_mpls) == alignof(net_addr));
|
||||||
|
STATIC_ASSERT(alignof(net_addr_aspa) == alignof(net_addr));
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
rd_format(const vpn_rd rd_, char *buf, int buflen)
|
rd_format(const vpn_rd rd_, char *buf, int buflen)
|
||||||
|
Loading…
Reference in New Issue
Block a user