From marka@drugs.dv.isc.org  Thu Aug 10 17:32:15 2000
Return-Path: <marka@drugs.dv.isc.org>
Received: from drugs.dv.isc.org (drugs.dv.isc.org [130.155.191.236])
	by hub.freebsd.org (Postfix) with ESMTP id AFBF637B8F9
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 10 Aug 2000 17:32:12 -0700 (PDT)
	(envelope-from marka@drugs.dv.isc.org)
Received: (from marka@localhost)
	by drugs.dv.isc.org (8.9.3/8.9.3) id KAA20407;
	Fri, 11 Aug 2000 10:33:59 +1000 (EST)
	(envelope-from marka)
Message-Id: <200008110033.KAA20407@drugs.dv.isc.org>
Date: Fri, 11 Aug 2000 10:33:59 +1000 (EST)
From: Mark.Andrews@nominum.com
Sender: marka@drugs.dv.isc.org
Reply-To: Mark.Andrews@nominum.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: CMSG_DATA requires additional header file to be included
X-Send-Pr-Version: 3.2

>Number:         20530
>Category:       misc
>Synopsis:       CMSG_DATA requires additional header file to be included
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    asmodai
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 10 17:40:01 PDT 2000
>Closed-Date:    Mon Jan 8 12:23:11 PST 2001
>Last-Modified:  Mon Jan 08 12:23:38 PST 2001
>Originator:     Mark Andrews
>Release:        FreeBSD 4.1-STABLE i386
>Organization:
Nominum
>Environment:


FreeBSD drugs.dv.isc.org 4.1-STABLE FreeBSD 4.1-STABLE #0: Tue Aug  8 18:01:02 EST 2000     marka@drugs.dv.isc.org:/usr/obj/usr/src/sys/DRUGS  i386

>Description:

	The CMSG_* macros use macros not defined in <sys/types.h> and
	<sys/socket.h> causing linkage failures.  CMSG_* macros manipulate
	data returned / sent by recvmsg() / sendmsg().  The only header
	files that should be required by a application are <sys/types.h>
	and <sys/socket.h>.

	FreeBSD is currently gratuitously differnet in its requirements
	w.r.t. the CMSG_* macros.

>How-To-Repeat:

	The following compiles and links on all platforms except FreeBSD,
	it is not expected to run without errors.

#include <sys/types.h>
#include <sys/socket.h>

int
main() {

        struct msghdr *msghdr = (struct msghdr *)0;
        struct cmsghdr *cmsghdr;
        unsigned char *data;

        cmsghdr = CMSG_FIRSTHDR(msghdr);
        data = CMSG_DATA(cmsghdr);
}


>Fix:

	Add #include <sys/param.h> to <sys/socket.h> or redefine relevent
	CMSG_* macros to use things only defined in <sys/types.h> and
	<sys/socket.h>.


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: johan 
State-Changed-When: Fri Aug 11 00:23:03 PDT 2000 
State-Changed-Why:  
Duplicate of PR 19971 
see http://www.FreeBSD.org/cgi/query-pr.cgi?pr=19971 


http://www.freebsd.org/cgi/query-pr.cgi?pr=20530 
State-Changed-From-To: closed->open 
State-Changed-By: asmodai 
State-Changed-When: Tue Aug 22 12:55:44 PDT 2000 
State-Changed-Why:  
Sorry for reopening this, but I have some interests in working 
on this with the guys at nominum, and this will help me track 
it better. 


Responsible-Changed-From-To: freebsd-bugs->asmodai 
Responsible-Changed-By: asmodai 
Responsible-Changed-When: Tue Aug 22 12:55:44 PDT 2000 
Responsible-Changed-Why:  
I am acting as the FreeBSD/BIND liaison. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20530 

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: asmodai@freebsd.org
Cc: Mark.Andrews@nominum.com, freebsd-gnats-submit@freebsd.org
Subject: Re: misc/20530: CMSG_DATA requires additional header file to be included 
Date: Wed, 23 Aug 2000 10:53:43 +0200

 On Tue, 22 Aug 2000 12:57:53 MST, asmodai@FreeBSD.ORG wrote:
 
 > Synopsis: CMSG_DATA requires additional header file to be included
 > 
 > State-Changed-From-To: closed->open
 > State-Changed-By: asmodai
 > State-Changed-When: Tue Aug 22 12:55:44 PDT 2000
 > State-Changed-Why: 
 > Sorry for reopening this, but I have some interests in working
 > on this with the guys at nominum, and this will help me track
 > it better.
 
 But isn't this a duplicate of PR 19971?
 
 Ciao,
 Sheldon.
 

From: Jeroen Ruigrok van der Werven <jruigrok@via-net-works.nl>
To: Sheldon Hearn <sheldonh@uunet.co.za>
Cc: Mark.Andrews@nominum.com, freebsd-gnats-submit@freebsd.org
Subject: Re: misc/20530: CMSG_DATA requires additional header file to be included
Date: Wed, 23 Aug 2000 11:06:20 +0200

 -On [20000823 11:00], Sheldon Hearn (sheldonh@uunet.co.za) wrote:
 >On Tue, 22 Aug 2000 12:57:53 MST, asmodai@FreeBSD.ORG wrote:
 >
 >> Synopsis: CMSG_DATA requires additional header file to be included
 >> 
 >> State-Changed-From-To: closed->open
 >> State-Changed-By: asmodai
 >> State-Changed-When: Tue Aug 22 12:55:44 PDT 2000
 >> State-Changed-Why: 
 >> Sorry for reopening this, but I have some interests in working
 >> on this with the guys at nominum, and this will help me track
 >> it better.
 >
 >But isn't this a duplicate of PR 19971?
 
 Kind of/yes.  But I can easier track this particular problem through
 this PR.
 
 This is a PR filed by the current maintainer(s) of BIND (ISC/Nominum)
 and I offered myself to be a liaison to solve any support issues FreeBSD
 has with the latest BIND versions.
 
 -- 
 Jeroen Ruigrok van der Werven          Network- and systemadministrator
 <jruigrok@via-net-works.nl>            VIA Net.Works The Netherlands
 BSD: Technical excellence at its best  http://www.via-net-works.nl
 The Idea does not replace the work...
 

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: Jeroen Ruigrok van der Werven <jruigrok@via-net-works.nl>
Cc: Mark.Andrews@nominum.com, freebsd-gnats-submit@freebsd.org
Subject: Re: misc/20530: CMSG_DATA requires additional header file to be included 
Date: Wed, 23 Aug 2000 11:13:38 +0200

 On Wed, 23 Aug 2000 11:06:20 +0200, Jeroen Ruigrok van der Werven wrote:
 
 > This is a PR filed by the current maintainer(s) of BIND (ISC/Nominum)
 > and I offered myself to be a liaison to solve any support issues FreeBSD
 > has with the latest BIND versions.
 
 So shall I close PR 19971 as superseded by this one?  I mean, once this
 is resolved, both PR's can be closed, right?
 
 Ciao,
 Sheldon.
 
State-Changed-From-To: open->feedback 
State-Changed-By: asmodai 
State-Changed-When: Tue Nov 14 01:28:02 PST 2000 
State-Changed-Why:  
CURRENT now has a solution in the source code. 
This will be revisited soon since Bruce Evans had some improvements. 

But this should at least remove the bogus dependency introduced in the 
header files. 
4-STABLE will be done as soon as the solution in CURRENT is final. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20530 
State-Changed-From-To: feedback->closed 
State-Changed-By: asmodai 
State-Changed-When: Mon Jan 8 12:23:11 PST 2001 
State-Changed-Why:  
Fix present in both CURRENT and 4.2-STABLE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20530 
>Unformatted:
