Fix too small control array in tftp code on BSD and SOLARIS
This causes tftp to fail on some BSD versions, for sure. It
works by chance on others.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241068
diff --git a/src/tftp.c b/src/tftp.c
index 435b216..c618a2c 100644
--- a/src/tftp.c
+++ b/src/tftp.c
@@ -68,9 +68,11 @@
#if defined(HAVE_LINUX_NETWORK)
char control[CMSG_SPACE(sizeof(struct in_pktinfo))];
#elif defined(HAVE_SOLARIS_NETWORK)
- char control[CMSG_SPACE(sizeof(unsigned int))];
+ char control[CMSG_SPACE(sizeof(struct in_addr)) +
+ CMSG_SPACE(sizeof(unsigned int))];
#elif defined(IP_RECVDSTADDR) && defined(IP_RECVIF)
- char control[CMSG_SPACE(sizeof(struct sockaddr_dl))];
+ char control[CMSG_SPACE(sizeof(struct in_addr)) +
+ CMSG_SPACE(sizeof(struct sockaddr_dl))];
#endif
} control_u;