[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GnuTLS 3, BSD, netinet/ip.h
From: |
Phil Pennock |
Subject: |
GnuTLS 3, BSD, netinet/ip.h |
Date: |
Tue, 22 May 2012 21:03:25 -0400 |
On 2012-05-22 at 10:28 +0200, Nikos Mavrogiannopoulos wrote:
[ EOF vs buffer overflow ]
> We have separate error codes for these conditions in gnutls 3.0.x.
Ah, thanks. FreeBSD Ports system and Ubuntu both lack GnuTLS 3, so I
stuck to 2.12.
Building GnuTLS 3 on my dated FreeBSD 7 series install is failing, but
when I check on a more recent (FreeBSD 9) system I see that the relevant
type has been changed to avoid the issue.
----------------------------8< cut here >8------------------------------
CC serv.o
In file included from common.h:31,
from serv.c:28:
/usr/include/netinet/ip.h:162: error: expected specifier-qualifier-list before
'n_long'
serv.c: In function 'tcp_server':
serv.c:1245: warning: cast to pointer from integer of different size
*** Error code 1
----------------------------8< cut here >8------------------------------
----------------------------8< cut here >8------------------------------
149 struct ip_timestamp {
...
161 union ipt_timestamp {
162 n_long ipt_time[1];
163 struct ipt_ta {
164 struct in_addr ipt_addr;
165 n_long ipt_time;
166 } ipt_ta[1];
167 } ipt_timestamp;
----------------------------8< cut here >8------------------------------
Editing src/common.h to #include <netinet/in_systm.h> just before
pulling in <netinet/ip.h> fixes this.
That in_systm.h file really just does:
typedef u_int16_t n_short;
typedef u_int32_t n_long;
typedef u_int32_t n_time;
(and a function definition if inside the kernel).
FreeBSD 9 has replaced n_long with uint32_t.
Browsing:
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netinet/ip.h
the annotated view shows this changed in file revision 1.34 and so is in
FreeBSD 8 onwards. FreeBSD 7.4 is a legacy release.
I just built with:
# if defined(__FreeBSD__) && __FreeBSD__ < 8
# include <netinet/in_systm.h>
# endif
# include <netinet/ip.h>
I see that NetBSD has switched to using "n_time" as the type:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/netinet/ip.h?rev=1.32&content-type=text/x-cvsweb-markup&only_with_tag=MAIN
and n_time seems to still require pulling in <netinet/in_systm.h>.
OpenBSD is also using n_time, I don't have a handy VM for that to grep
over the source tree and confirm that <netinet/in_systm.h> is the only
definition and the only include path in userland.
http://www.openbsd.org/cgi-bin/cvsweb/src/sys/netinet/ip.h?rev=1.13;content-type=text%2Fx-cvsweb-markup
I don't touch autoconf enough to provide a good solution for you, sorry.
-Phil
- Re: GnuTLS/NSS interop in Exim 4.80 RC, (continued)
- Re: GnuTLS/NSS interop in Exim 4.80 RC, Nikos Mavrogiannopoulos, 2012/05/20
- Re: GnuTLS/NSS interop in Exim 4.80 RC, Phil Pennock, 2012/05/20
- Re: GnuTLS/NSS interop in Exim 4.80 RC, Phil Pennock, 2012/05/20
- Re: GnuTLS/NSS interop in Exim 4.80 RC, Nikos Mavrogiannopoulos, 2012/05/21
- Re: GnuTLS/NSS interop in Exim 4.80 RC, Phil Pennock, 2012/05/21
- Re: GnuTLS/NSS interop in Exim 4.80 RC, Phil Pennock, 2012/05/21
- Re: GnuTLS/NSS interop in Exim 4.80 RC, Janne Snabb, 2012/05/22
- Re: GnuTLS/NSS interop in Exim 4.80 RC, Nikos Mavrogiannopoulos, 2012/05/22
- Re: GnuTLS/NSS interop in Exim 4.80 RC, Phil Pennock, 2012/05/22
- Re: GnuTLS/NSS interop in Exim 4.80 RC, Nikos Mavrogiannopoulos, 2012/05/22
- GnuTLS 3, BSD, netinet/ip.h,
Phil Pennock <=
- Re: GnuTLS 3, BSD, netinet/ip.h, Nikos Mavrogiannopoulos, 2012/05/23
- Re: GnuTLS 3, BSD, netinet/ip.h, Phil Pennock, 2012/05/23
- Re: GnuTLS 3, BSD, netinet/ip.h, Nikos Mavrogiannopoulos, 2012/05/23
- Re: GnuTLS 3, BSD, netinet/ip.h, Janne Snabb, 2012/05/24
- Re: GnuTLS 3, BSD, netinet/ip.h, Phil Pennock, 2012/05/25
- Re: GnuTLS 3, BSD, netinet/ip.h, Tobias Gruetzmacher, 2012/05/29
- Re: GnuTLS/NSS interop in Exim 4.80 RC, Janne Snabb, 2012/05/22
- Re: GnuTLS/NSS interop in Exim 4.80 RC, Patrick Pelletier, 2012/05/22
- Re: GnuTLS/NSS interop in Exim 4.80 RC, Nikos Mavrogiannopoulos, 2012/05/22
- Re: GnuTLS/NSS interop in Exim 4.80 RC, Nikos Mavrogiannopoulos, 2012/05/22