From 69e1325faf47762fd08917b8f20a20abb59d41e6 Mon Sep 17 00:00:00 2001 From: gdt Date: Mon, 15 Nov 2004 18:51:15 +0000 Subject: Rationalize CMSG_SPACE usage: in lib/zebra.h, ensure that RFC3542-required CMSG_SPACE and CMSG_LEN are defined. Warn if alignment assumptions are made, since they are i386-centric. in lib/sockopt.h, declare that sockopt sizes are without CMSG_SPACE-required padding - just simple sizeof. in ospfd/ospf_packet.c, simply use CMSG_SPACE This should remove all instances of CMSG_ALIGN from the source code. This is a nonstandard, though rational, construct; quagga should use only those defines in RFC3542. --- lib/sockopt.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/sockopt.h') diff --git a/lib/sockopt.h b/lib/sockopt.h index bec26163..df199c19 100644 --- a/lib/sockopt.h +++ b/lib/sockopt.h @@ -44,7 +44,7 @@ int setsockopt_ipv6_multicast_loop (int, int); * Size defines for control messages used to get ifindex. We define * values for each method, and define a macro that can be used by code * that is unaware of which method is in use. - * XXX Needs to use CMSG_DATA and CMSG_ALIGN. + * These values are without any alignment needed (see CMSG_SPACE in RFC3542). */ #if defined (IP_PKTINFO) /* Linux in_pktinfo. */ @@ -61,8 +61,7 @@ int setsockopt_ipv6_multicast_loop (int, int); #if defined (SUNOS_5) #define SOPT_SIZE_CMSG_RECVIF_IPV4() (sizeof (uint_t)) #else -#define SOPT_SIZE_CMSG_RECVIF_IPV4() \ - __CMSG_ALIGN((sizeof (struct sockaddr_dl))) +#define SOPT_SIZE_CMSG_RECVIF_IPV4() (sizeof (struct sockaddr_dl)) #endif /* SUNOS_5 */ #endif /* IP_RECVIF */ -- cgit v1.2.1