From: gdt Date: Thu, 26 Aug 2004 13:14:07 +0000 (+0000) Subject: 2004-08-26 Greg Troxel X-Git-Tag: frr-2.0-rc1~3608 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d0deca68371c222d1b2ff3fcf61312506395861c;p=mirror%2Ffrr.git 2004-08-26 Greg Troxel * 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. --- diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog index 1339ba24a4..3da4571f09 100644 --- a/ospfd/ChangeLog +++ b/ospfd/ChangeLog @@ -1,3 +1,11 @@ +2004-08-26 Greg Troxel + + * 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. + 2004-08-19 Paul Jakma * ospf_packet.c: update to match sockopt renames. diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index ce82ee27c1..8bc49666b0 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;