summaryrefslogtreecommitdiff
path: root/ospfd/ospf_packet.c
diff options
context:
space:
mode:
authorgdt <gdt>2004-08-26 13:14:07 +0000
committergdt <gdt>2004-08-26 13:14:07 +0000
commitd0deca68371c222d1b2ff3fcf61312506395861c (patch)
tree387b78bd5cf21d645f33617ea4b5bb7eb58ce613 /ospfd/ospf_packet.c
parentafa43b23925175ff750d91bbd1c639b47bcb597e (diff)
2004-08-26 Greg Troxel <gdt@fnord.ir.bbn.com>
* ospf_packet.c (ospf_recv_packet): adjust size declaration of buffer used to get interface index so that it compiles on other than Linux and includes the required alignment space. Probably this was only working on sparc/sparc64 because most of sockaddr_dl was not being written.
Diffstat (limited to 'ospfd/ospf_packet.c')
-rw-r--r--ospfd/ospf_packet.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index ce82ee27..8bc49666 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -1881,7 +1881,12 @@ ospf_recv_packet (int fd, struct interface **ifp)
unsigned int ifindex = 0;
struct iovec iov;
struct cmsghdr *cmsg;
- char buff [sizeof (*cmsg) + SOPT_SIZE_CMSG_PKTINFO_IPV4()];
+#if defined(CMSG_SPACE)
+ /* Header and data both require alignment. */
+ char buff [CMSG_SPACE(SIZE_CMSG_IFINDEX_IPV4())];
+#else
+ char buff [sizeof (*cmsg) + SOPT_SIZE_CMSG_IFINDEX_IPV4()];
+#endif
struct msghdr msgh;
msgh.msg_name = NULL;