From owner-svn-src-all@freebsd.org Tue May 31 13:32:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 780C5B55D5B; Tue, 31 May 2016 13:32:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 489B211C5; Tue, 31 May 2016 13:32:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VDWXg0028940; Tue, 31 May 2016 13:32:33 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4VDWXAo028939; Tue, 31 May 2016 13:32:33 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605311332.u4VDWXAo028939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 31 May 2016 13:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301038 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2016 13:32:34 -0000 Author: ed Date: Tue May 31 13:32:33 2016 New Revision: 301038 URL: https://svnweb.freebsd.org/changeset/base/301038 Log: Make CMSG_*() work without having NULL available. The is not supposed to declare NULL, according to POSIX. Our implementation complies with that, meaning that we need to make sure that CMSG_*() doesn't use it. Modified: head/sys/sys/socket.h Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Tue May 31 13:31:19 2016 (r301037) +++ head/sys/sys/socket.h Tue May 31 13:32:33 2016 (r301038) @@ -500,7 +500,7 @@ struct sockcred { /* given pointer to struct cmsghdr, return pointer to next cmsghdr */ #define CMSG_NXTHDR(mhdr, cmsg) \ - ((char *)(cmsg) == NULL ? CMSG_FIRSTHDR(mhdr) : \ + ((char *)(cmsg) == (char *)0 ? CMSG_FIRSTHDR(mhdr) : \ ((char *)(cmsg) + _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len) + \ _ALIGN(sizeof(struct cmsghdr)) > \ (char *)(mhdr)->msg_control + (mhdr)->msg_controllen) ? \ @@ -515,7 +515,7 @@ struct sockcred { #define CMSG_FIRSTHDR(mhdr) \ ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \ (struct cmsghdr *)(mhdr)->msg_control : \ - (struct cmsghdr *)NULL) + (struct cmsghdr *)0) #if __BSD_VISIBLE /* RFC 2292 additions */