openssh-3.2.2p1 on Linux 2.0

NIDE Naoyuki nide at ics.nara-wu.ac.jp
Fri May 17 18:42:57 EST 2002


  Hi

  I've found that openssh-3.2.2p1 can't be compiled on my Linux 2.0.36,
because it doesn't define CMSG_DATA and CMSG_FIRSTHDR in <linux/socket.h>.
The patch below solved this problem.

Regards,
				NIDE Maoyuki, nide at ics.nara-wu.ac.jp

------------------------------------------------------------------------
diff -ru openssh-3.2.2p1.orig/defines.h openssh-3.2.2p1/defines.h
--- openssh-3.2.2p1.orig/defines.h	Fri Apr 26 02:56:07 2002
+++ openssh-3.2.2p1/defines.h	Fri May 17 17:21:13 2002
@@ -410,6 +410,15 @@
 #define	CMSG_SPACE(len)	(__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
 #endif
 
+/* Linux 2.0 does not have CMSG_DATA, CMSG_FIRSTHDR */
+#ifndef CMSG_DATA
+#define CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr))))
+#endif
+#ifndef CMSG_FIRSTHDR
+#define CMSG_FIRSTHDR(msg) (((msg)->msg_controllen) >= sizeof(struct cmsghdr) ? \
+	(struct cmsghdr *)((msg)->msg_control) : (struct cmsghdr *)NULL)
+#endif
+
 /* Function replacement / compatibility hacks */
 
 #if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO))



More information about the openssh-unix-dev mailing list