Skip to contentSkip to conversation

Patch for compile-time problems on NetBSD and OpenBSD (trac #17)

Openvpn-devel Applied Gert Doering 3 participants 5 messages Jul 9, 2010 – Aug 17, 2010

lore
Share & tools
lore
#0 lore raw

Hi,

the following patch fixes the IFF_MULTICAST compile-time problems on NetBSD, and it should also fix them on OpenBSD (trac entry #17).

** important: after applying the patch to configure.ac, you MUST run ** "autoreconf" - otherwise the patch won't do anything

If it still doesn't work for OpenBSD, I need to see the parts from your config.log relating to <net/if.h>

gert

-------------- snip ----------------

---
 configure.ac |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
configure.ac +3 -0
index 4626e46..b91a41c 100644
@@ -371,6 +371,9 @@ if test "${WIN32}" != "yes"; then
 		 [#ifdef HAVE_SYS_SOCKET_H 
 		  # include <sys/socket.h>
 		  #endif
+	          #ifdef HAVE_SYS_TYPES_H
+		  # include <sys/types.h>
+		  #endif
 		 ])
    AC_CHECK_HEADERS(netinet/ip.h,,,
 		 [#ifdef HAVE_SYS_TYPES_H
Signature · 7 lines
1.6.4.4

-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#1 lore raw

Am 09.07.2010, 10:31 Uhr, schrieb Gert Doering:

Quoted 7 lines

Hi,

the following patch fixes the IFF_MULTICAST compile-time problems on NetBSD, and it should also fix them on OpenBSD (trac entry #17).

** important: after applying the patch to configure.ac, you MUST run ** "autoreconf" - otherwise the patch won't do anything

The "MUST" sounds quite strong here.

Usually, and providing the patch utility does not apply an older timestamp to configure.ac, automake will generate Makefiles so that they detect that configure needs to be refreshed and re-run. I sometimes see this fail with BSD make, or see that it happens at the *end* of a BSD make run rather than at the beginning. I recall there have been relevant fixes; if those are insufficient, and you'd been using the latest release version of automake, consider reporting he issue upstream.

I have never seen this with GNU make though - providing your automake is new enough and you don't add options so that the user must add --enable-maintainer-mdoe (I don't see it on the 2.2beta branch in Git though).

Signature · 1 line
Matthias Andree
#2 lore raw
In reply to Gert Doering

Hi,

Quoted 2 lines · Gert Doering

the following patch fixes the IFF_MULTICAST compile-time problems on NetBSD, and it should also fix them on OpenBSD (trac entry #17).

This would have been too easy... on NetBSD, <sys/socket.h> can be include before <sys/types.h> (which the original patch does), on OpenBSD, this fails.

So I have swapped around these two includes in the <net/if.h> test program compiled by configure, and it now configure and compiles both on NetBSD and on OpenBSD just fine. (Last time I had no OpenBSD to test - in the mean time, I've setup an OpenBSD 4.7 VM and tested it myself, so I'm *sure* it works :-) ).

Due to the fact that I've commited this in two goes, it's "two patches" now... I've appended both. Please apply to a clean configure.ac file, and to be sure, run "autoreconf" to rebuild "configure" (to Matthias:
well, the magic might do this automatically, but before I get another bug report "your patch did not help" which could then be due to "autoreconf not run", I'll just make *sure* it was rebuilt).

"David needs an independent ACK on this, so please test on NetBSD and OpenBSD and give feedback".

gert

------------------------------------------------

#3 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 23 lines · Gert Doering

Hi,

Quoted 2 lines · Gert Doering

the following patch fixes the IFF_MULTICAST compile-time problems on NetBSD, and it should also fix them on OpenBSD (trac entry #17).

This would have been too easy... on NetBSD, <sys/socket.h> can be include before <sys/types.h> (which the original patch does), on OpenBSD, this fails.

So I have swapped around these two includes in the <net/if.h> test program compiled by configure, and it now configure and compiles both on NetBSD and on OpenBSD just fine. (Last time I had no OpenBSD to test - in the mean time, I've setup an OpenBSD 4.7 VM and tested it myself, so I'm *sure* it works :-) ).

Due to the fact that I've commited this in two goes, it's "two patches" now... I've appended both. Please apply to a clean configure.ac file, and to be sure, run "autoreconf" to rebuild "configure" (to Matthias:
well, the magic might do this automatically, but before I get another bug report "your patch did not help" which could then be due to "autoreconf not run", I'll just make *sure* it was rebuilt).

Quoted 5 lines

"David needs an independent ACK on this, so please test on NetBSD and OpenBSD and give feedback".

gert

ACK received in Trac:
<https://community.openvpn.net/openvpn/ticket/17>

commit 422e5e751e73de8a17760acf2f15f61ea4f0394e

Author: Gert Doering <[email protected]...>
Date:   Sat Jul 10 11:24:41 2010 +0200
    Fix <net/if.h> compile time problems on OpenBSD for good

    Previous fix (commit eb973e055bc249948) fixed NetBSD but not OpenBSD
    (include <sys/socket.h> *after* <sys/types.h>)

    Signed-off-by: Gert Doering <[email protected]...>
    Acked-by: krzee <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

Applied to bugfix2.1, merged into allmerged and beta2.2.

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkxq6ioACgkQDC186MBRfrpX8ACfaGqn2ywOCYha0SKGRfdQBj+n MkYAmgJLR8trKICDgc+khYeMzrWzQVg3
=zOS4
-----END PGP SIGNATURE-----

Acked-by krzee Applied
#4 lore raw
In reply to Gert Doering

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Gert Doering

Hi,

the following patch fixes the IFF_MULTICAST compile-time problems on NetBSD, and it should also fix them on OpenBSD (trac entry #17).

Quoted 8 lines

** important: after applying the patch to configure.ac, you MUST run ** "autoreconf" - otherwise the patch won't do anything

If it still doesn't work for OpenBSD, I need to see the parts from your config.log relating to <net/if.h>

gert

ACK recieved in Trac:
<https://community.openvpn.net/openvpn/ticket/17>

commit eb973e055bc249948351cacf1aa045d878ed041d

Author: Gert Doering <[email protected]...>
Date:   Fri Jul 9 10:24:46 2010 +0200

Fix compile problems on NetBSD and OpenBSD

Configure will not find <net/if.h> due to missing <sys/types.h> in the test program, and thus, tun.c will fail to compile with missing symbol IFF_MULTICAST.

Applied to bugfix2.1, merged into allmerged and beta2.2.

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkxq6fYACgkQDC186MBRfroFygCff6kL1IMcEqlk3O1tMLwPfL+B hdEAn08b+W4GLcWxX24dq7XeLHFJJXzO
=oY7H
-----END PGP SIGNATURE-----