]> git.puffer.fish Git - matthieu/frr.git/commitdiff
2004-08-26 Greg Troxel <gdt@fnord.ir.bbn.com>
authorgdt <gdt>
Thu, 26 Aug 2004 13:14:07 +0000 (13:14 +0000)
committergdt <gdt>
Thu, 26 Aug 2004 13:14:07 +0000 (13:14 +0000)
* 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.

ospfd/ChangeLog
ospfd/ospf_packet.c

index 1339ba24a497f97e0a458f837423ba23f5a2fa7c..3da4571f095883dc6ec3d1303cc00ed0f8605494 100644 (file)
@@ -1,3 +1,11 @@
+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.
+
 2004-08-19 Paul Jakma <paul@dishone.st>
 
        * ospf_packet.c: update to match sockopt renames.
index ce82ee27c11ede91242cfbd3bc7e19fcd5a6978f..8bc49666b0fc0454592fec64ac4399ccc9b8e10f 100644 (file)
@@ -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;