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.
diff --git a/lib/sockopt.h b/lib/sockopt.h
index bec2616..df199c1 100644
--- a/lib/sockopt.h
+++ b/lib/sockopt.h
@@ -44,7 +44,7 @@
* 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 @@
#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 */