summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--defines.h37
2 files changed, 22 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 097b08f16..cf88cca4c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
3 - markus@cvs.openbsd.org 2003/08/14 16:08:58 3 - markus@cvs.openbsd.org 2003/08/14 16:08:58
4 [ssh-keygen.c] 4 [ssh-keygen.c]
5 exit after primetest, ok djm@ 5 exit after primetest, ok djm@
6 - (dtucker) [defines.h] Put CMSG_DATA, CMSG_FIRSTHDR with other CMSG* macros,
7 change CMSG_DATA to use __CMSG_ALIGN (and thus work properly), reformat for
8 consistency.
6 9
720030813 1020030813
8 - (dtucker) [session.c] Remove #ifdef TIOCSBRK kludge. 11 - (dtucker) [session.c] Remove #ifdef TIOCSBRK kludge.
@@ -840,4 +843,4 @@
840 - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. 843 - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
841 Report from murple@murple.net, diagnosis from dtucker@zip.com.au 844 Report from murple@murple.net, diagnosis from dtucker@zip.com.au
842 845
843$Id: ChangeLog,v 1.2894 2003/08/21 06:44:07 dtucker Exp $ 846$Id: ChangeLog,v 1.2895 2003/08/21 06:49:41 dtucker Exp $
diff --git a/defines.h b/defines.h
index 3679ea549..b2ea15d9f 100644
--- a/defines.h
+++ b/defines.h
@@ -25,7 +25,7 @@
25#ifndef _DEFINES_H 25#ifndef _DEFINES_H
26#define _DEFINES_H 26#define _DEFINES_H
27 27
28/* $Id: defines.h,v 1.100 2003/08/07 05:58:28 dtucker Exp $ */ 28/* $Id: defines.h,v 1.101 2003/08/21 06:49:41 dtucker Exp $ */
29 29
30 30
31/* Constants */ 31/* Constants */
@@ -437,6 +437,23 @@ struct winsize {
437#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len)) 437#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
438#endif 438#endif
439 439
440/* given pointer to struct cmsghdr, return pointer to data */
441#ifndef CMSG_DATA
442#define CMSG_DATA(cmsg) ((u_char *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr)))
443#endif /* CMSG_DATA */
444
445/*
446 * RFC 2292 requires to check msg_controllen, in case that the kernel returns
447 * an empty list for some reasons.
448 */
449#ifndef CMSG_FIRSTHDR
450#define CMSG_FIRSTHDR(mhdr) \
451 ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
452 (struct cmsghdr *)(mhdr)->msg_control : \
453 (struct cmsghdr *)NULL)
454#endif /* CMSG_FIRSTHDR */
455
456
440/* Function replacement / compatibility hacks */ 457/* Function replacement / compatibility hacks */
441 458
442#if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO)) 459#if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO))
@@ -577,22 +594,4 @@ struct winsize {
577 594
578/** end of login recorder definitions */ 595/** end of login recorder definitions */
579 596
580#ifndef CMSG_DATA
581/* given pointer to struct cmsghdr, return pointer to data */
582#define CMSG_DATA(cmsg) \
583 ((u_char *)(cmsg) + (((u_int)(sizeof(struct cmsghdr)) \
584 (sizeof(int) - 1)) &~ (sizeof(int) - 1)))
585#endif /* CMSG_DATA */
586
587#ifndef CMSG_FIRSTHDR
588/*
589 * RFC 2292 requires to check msg_controllen, in case that the kernel returns
590 * an empty list for some reasons.
591 */
592# define CMSG_FIRSTHDR(mhdr) \
593 ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
594 (struct cmsghdr *)(mhdr)->msg_control : \
595 (struct cmsghdr *)NULL)
596#endif /* CMSG_FIRSTHDR */
597
598#endif /* _DEFINES_H */ 597#endif /* _DEFINES_H */