Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 Nov 2006 17:38:33 -0500
From:      Randall Stewart <rrs@cisco.com>
To:        Ruslan Ermilov <ru@freebsd.org>
Cc:        cvs-src@freebsd.org, Doug Barton <dougb@freebsd.org>, src-committers@freebsd.org, cvs-all@freebsd.org, John Baldwin <jhb@freebsd.org>
Subject:   Re: cvs commit: src/sys/netinet sctp_asconf.c
Message-ID:  <454BC4E9.9080708@cisco.com>
In-Reply-To: <20061103223016.GA55720@rambler-co.ru>
References:  <200611031948.kA3JmuZ6072620@repoman.freebsd.org> <454BB06E.40202@cisco.com> <454BB5DC.4030903@cisco.com> <200611031703.29182.jhb@freebsd.org> <20061103223016.GA55720@rambler-co.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Ruslan Ermilov wrote:
> On Fri, Nov 03, 2006 at 05:03:28PM -0500, John Baldwin wrote:
> 
>>On Friday 03 November 2006 16:34, Randall Stewart wrote:
>>
>>>/src/sys/netinet/sctp_usrreq.c: In function `sctp_optsset':
>>>/src/sys/netinet/sctp_usrreq.c:3136: warning: cast from pointer to 
>>>integer of different size
>>>
>>>
>>>The above one I will have to ask if any one of you can give
>>>me a hand.. I am not a sparcy person ;-) and the line is:
>>>			on_off = (mtod(m, int));
>>>
>>>(on_off is declared as a int on_off; a few lines above it).
>>
>>mtod() returns a pointer.  If you want to get an int out of the
>>mbuf data, then maybe something like:
>>
>>	on_off = ntohl(*mtod(m, int *)));
>>
>>is what you want.  As it is, you are casting m->m_data (char *) to an int and 
>>returning the raw value of the data pointer into your int. :)
>>
> 
> This is the setsockopt()/getsockopt() backend, so it looks like
> no ntohl() is actually necessary.
> 
> 

yep..

R
> Cheers,


-- 
Randall Stewart
NSSTG - Cisco Systems Inc.
803-345-0369 <or> 803-317-4952 (cell)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?454BC4E9.9080708>