]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- (dtucker) [defines.h] Put CMSG_DATA, CMSG_FIRSTHDR with other CMSG* macros,
authorDarren Tucker <dtucker@zip.com.au>
Thu, 21 Aug 2003 06:49:41 +0000 (16:49 +1000)
committerDarren Tucker <dtucker@zip.com.au>
Thu, 21 Aug 2003 06:49:41 +0000 (16:49 +1000)
   change CMSG_DATA to use __CMSG_ALIGN (and thus work properly), reformat for
   consistency.

ChangeLog
defines.h

index 097b08f16a70bda929e89fc45397e09d6440b2cf..cf88cca4ca29049ad3d297fe0dd6b5eca74f4570 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
    - markus@cvs.openbsd.org 2003/08/14 16:08:58
      [ssh-keygen.c]
      exit after primetest, ok djm@
+ - (dtucker) [defines.h] Put CMSG_DATA, CMSG_FIRSTHDR with other CMSG* macros,
+   change CMSG_DATA to use __CMSG_ALIGN (and thus work properly), reformat for
+   consistency.
 
 20030813
  - (dtucker) [session.c] Remove #ifdef TIOCSBRK kludge.
  - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
    Report from murple@murple.net, diagnosis from dtucker@zip.com.au
 
-$Id: ChangeLog,v 1.2894 2003/08/21 06:44:07 dtucker Exp $
+$Id: ChangeLog,v 1.2895 2003/08/21 06:49:41 dtucker Exp $
index 3679ea549ef8b585c86ffbb67c1b1c0d87888811..b2ea15d9f14614776b1c1028b561fd3ad8006c6d 100644 (file)
--- a/defines.h
+++ b/defines.h
@@ -25,7 +25,7 @@
 #ifndef _DEFINES_H
 #define _DEFINES_H
 
-/* $Id: defines.h,v 1.100 2003/08/07 05:58:28 dtucker Exp $ */
+/* $Id: defines.h,v 1.101 2003/08/21 06:49:41 dtucker Exp $ */
 
 
 /* Constants */
@@ -437,6 +437,23 @@ struct winsize {
 #define        CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
 #endif
 
+/* given pointer to struct cmsghdr, return pointer to data */
+#ifndef CMSG_DATA
+#define CMSG_DATA(cmsg) ((u_char *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr)))
+#endif /* CMSG_DATA */
+
+/*
+ * RFC 2292 requires to check msg_controllen, in case that the kernel returns
+ * an empty list for some reasons.
+ */
+#ifndef CMSG_FIRSTHDR
+#define CMSG_FIRSTHDR(mhdr) \
+       ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
+        (struct cmsghdr *)(mhdr)->msg_control : \
+        (struct cmsghdr *)NULL)
+#endif /* CMSG_FIRSTHDR */
+
+
 /* Function replacement / compatibility hacks */
 
 #if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO))
@@ -577,22 +594,4 @@ struct winsize {
 
 /** end of login recorder definitions */
 
-#ifndef CMSG_DATA
-/* given pointer to struct cmsghdr, return pointer to data */
-#define CMSG_DATA(cmsg) \
-       ((u_char *)(cmsg) +  (((u_int)(sizeof(struct cmsghdr)) \
-        (sizeof(int) - 1)) &~ (sizeof(int) - 1)))
-#endif /* CMSG_DATA */
-
-#ifndef CMSG_FIRSTHDR
-/*
- * RFC 2292 requires to check msg_controllen, in case that the kernel returns
- * an empty list for some reasons.
- */
-# define CMSG_FIRSTHDR(mhdr) \
-       ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
-        (struct cmsghdr *)(mhdr)->msg_control : \
-        (struct cmsghdr *)NULL)
-#endif /* CMSG_FIRSTHDR */
-
 #endif /* _DEFINES_H */