summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
authorgdt <gdt>2004-11-15 18:51:15 +0000
committergdt <gdt>2004-11-15 18:51:15 +0000
commit69e1325faf47762fd08917b8f20a20abb59d41e6 (patch)
tree60d6df8c1d754c84fa3108a5f19bbf91cb084ab1 /ospfd
parentfbb6709986ee29b57a8a6103c592de80647ead00 (diff)
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.
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ChangeLog5
-rw-r--r--ospfd/ospf_packet.c4
2 files changed, 5 insertions, 4 deletions
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog
index b8f526e7..11fb3b60 100644
--- a/ospfd/ChangeLog
+++ b/ospfd/ChangeLog
@@ -1,3 +1,8 @@
+2004-11-15 Greg Troxel <gdt@fnord.ir.bbn.com>
+
+ * ospf_packet.c (ospf_recv_packet): Assume CMSG_SPACE is present
+ and works (lib/zebra.h provides if OS doesn't).
+
2004-11-15 Paul Jakma <paul@dishone.st>
* ospf_{apiserver,te}.c: ospf_lsa_free's should be ospf_lsa_unlock.
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 5a1c0916..c582533b 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -2007,12 +2007,8 @@ ospf_recv_packet (int fd, struct interface **ifp)
struct stream *ibuf;
unsigned int ifindex = 0;
struct iovec iov;
-#if defined(CMSG_SPACE)
/* Header and data both require alignment. */
char buff [CMSG_SPACE(SOPT_SIZE_CMSG_IFINDEX_IPV4())];
-#else
- char buff [sizeof (struct cmsghdr) + SOPT_SIZE_CMSG_IFINDEX_IPV4()];
-#endif
struct msghdr msgh;
memset (&msgh, 0, sizeof (struct msghdr));