From: itojun Date: Sat, 4 Mar 2000 02:34:23 +0000 (+0000) Subject: to be Posix.1g compliant, fix ancillary message alignment. it will now be X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a779b748fc6f24797e8c8ce9a7d929e798a2576e;p=openbsd to be Posix.1g compliant, fix ancillary message alignment. it will now be aligned to ALIGNBYTES (arch dependent). NOTE: the change requires you to recompile IPv6 userland, if you are on arch that is ALIGNBYTES != sizeof(long) - 1 (sparc seems to be it). sorry for the mess. --- diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 680042fa223..6e2c892c1e7 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -1,4 +1,4 @@ -/* $OpenBSD: socket.h,v 1.31 2000/02/18 05:21:01 itojun Exp $ */ +/* $OpenBSD: socket.h,v 1.32 2000/03/04 02:34:23 itojun Exp $ */ /* $NetBSD: socket.h,v 1.14 1996/02/09 18:25:36 christos Exp $ */ /* @@ -39,6 +39,11 @@ #ifndef _SYS_SOCKET_H_ #define _SYS_SOCKET_H_ +/* + * needed for ALIGNBYTES + */ +#include + /* * Definitions related to sockets: types, address families, options. */ @@ -356,7 +361,7 @@ struct cmsghdr { #define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control) /* Round len up to next alignment boundary */ -#define CMSG_ALIGN(len) (((len)+sizeof(long)-1) & ~(sizeof(long)-1)) +#define CMSG_ALIGN(len) ALIGN(len) /* Length of the contents of a control message of length len */ #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))