Bug 20530

Summary: CMSG_DATA requires additional header file to be included
Product: Base System Reporter: mark.andrews <mark.andrews>
Component: miscAssignee: Jeroen Ruigrok van der Werven <asmodai>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1-STABLE   
Hardware: Any   
OS: Any   

Description mark.andrews 2000-08-11 01:40:01 UTC
	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.

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>.
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);
}
Comment 1 Johan Karlsson freebsd_committer freebsd_triage 2000-08-11 08:23:03 UTC
State Changed
From-To: open->closed

Duplicate of PR 19971 
see http://www.FreeBSD.org/cgi/query-pr.cgi?pr=19971
Comment 2 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2000-08-22 20:55:44 UTC
State Changed
From-To: closed->open

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. 


Comment 3 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2000-08-22 20:55:44 UTC
Responsible Changed
From-To: freebsd-bugs->asmodai

I am acting as the FreeBSD/BIND liaison.
Comment 4 Sheldon Hearn 2000-08-23 09:53:43 UTC
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.
Comment 5 jruigrok 2000-08-23 10:06:20 UTC
-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...
Comment 6 Sheldon Hearn 2000-08-23 10:13:38 UTC
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.
Comment 7 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2000-11-14 09:28:02 UTC
State Changed
From-To: open->feedback

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.
Comment 8 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2001-01-08 20:23:11 UTC
State Changed
From-To: feedback->closed

Fix present in both CURRENT and 4.2-STABLE.