]> andersk Git - openssh.git/commitdiff
- (dtucker) [defines.h] Put CMSG_DATA, CMSG_FIRSTHDR with other CMSG* macros,
authordtucker <dtucker>
Thu, 21 Aug 2003 06:49:41 +0000 (06:49 +0000)
committerdtucker <dtucker>
Thu, 21 Aug 2003 06:49:41 +0000 (06:49 +0000)
   change CMSG_DATA to use __CMSG_ALIGN (and thus work properly), reformat for
   consistency.

ChangeLog
defines.h

index 8f4df44695fe57accd420a735d1758f1db1412a9..1923446fbedf48a65892576caa103729c9c6cfbe 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.
index 45a1f1a6d923b44114a02558015f09642a982fca..f1f639e7dbacfcbfc88a60e43a7c28bb9ed8f82d 100644 (file)
--- a/defines.h
+++ b/defines.h
@@ -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 */
This page took 0.062018 seconds and 5 git commands to generate.