Fix FreeBSD/OpenBSD/NetBSD compiler warnings in get_default_gateway()
PATCH 1/1 Fix FreeBSD/OpenBSD/NetBSD compiler warnings in get_default_gateway()
On these platforms (including DragonFly), get_default_gateway() would in some cases return false. As get_default_gateway() is defined as a void function, and none of the callers expect a return value -> just return without any value.
--- route.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
route.c +4 -4
@@ -2581,7 +2581,7 @@ get_default_gateway (struct route_gateway_info *rgi)warn ("writing to routing socket" );gc_free (&gc);close (s); -return false; +return ; } do {
@@ -2605,7 +2605,7 @@ get_default_gateway (struct route_gateway_info *rgi)else {gc_free (&gc); -return false; +return ; }
@@ -2947,7 +2947,7 @@ get_default_gateway (struct route_gateway_info *rgi)warn ("writing to routing socket" );gc_free (&gc);close (s); -return false; +return ; } do {
@@ -2971,7 +2971,7 @@ get_default_gateway (struct route_gateway_info *rgi)else {gc_free (&gc); -return false; +return ; }
Signature · 1 line
1.7.4.4
PATCH 1/1 Clean-up: check_subnet_conflict() function was #if 0 -> remove it
As the body of the check_subnet_conflict() function was disabled with an #if 0 clause, remove this function and clean up all places this function was called.
This function also expected get_default_gateway() to return data, which it does not do any more. Hence this function is "out-of-date" and no longer usefull.
--- route.c | 1 - tun.c | 42 ------------------------------------------ tun.h | 4 ---- 3 files changed, 0 insertions(+), 47 deletions(-)
route.c +0 -1
@@ -1001,7 +1001,6 @@ add_routes (struct route_list *rl, struct route_ipv6_list *rl6, const struct tunfor (i =0 ; i < rl->n; ++i) {struct route *r = &rl->routes[i]; -check_subnet_conflict (r->network, r->netmask,"route" );if (flags &ROUTE_DELETE_FIRST )delete_route (r, tt, flags, &rl->rgi, es);add_route (r, tt, flags, &rl->rgi, es);
tun.c +0 -42
54 lines not on this page · raw message
tun.h +0 -4
@@ -248,10 +248,6 @@ const char *ifconfig_options_string (const struct tuntap* tt, bool remote, boolbool is_tun_p2p (const struct tuntap *tt); -void check_subnet_conflict (const in_addr_t ip, -const in_addr_t netmask, -const char *prefix); -void warn_on_use_of_common_subnets (void );/*
Signature · 1 line
1.7.4.4
Re: [Openvpn-devel] [PATCH] Clean-up: check_subnet_conflict() function was #if 0 -> remove it
hi,
Quoted 7 lines · David Sommerseth
As the body of the
check_subnet_conflict()function was disabled with an #if 0 clause, remove this function and clean up all places this function was called.This function also expected
get_default_gateway()to return data, which it does not do any more. Hence this function is "out-of-date" and no longer usefull.
I agree with the assessment, but come to a different conclusion - I think the functionality is worthwile to have, so maybe we should try to repair it, instead of throwing it out completely.
Meeting topic?
gert
Signature · 4 lines
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]...Re: [Openvpn-devel] [PATCH] Clean-up: check_subnet_conflict() function was #if 0 -> remove it
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 11 lines · Gert Doering
hi,
Quoted 7 lines · David Sommerseth
As the body of the
check_subnet_conflict()function was disabled with an #if 0 clause, remove this function and clean up all places this function was called.This function also expected
get_default_gateway()to return data, which it does not do any more. Hence this function is "out-of-date" and no longer usefull.
Quoted 5 lines
I agree with the assessment, but come to a different conclusion - I think the functionality is worthwile to have, so maybe we should try to repair it, instead of throwing it out completely.
Meeting topic?
Agreed, lets put this on the agenda. I've Cc'ed James, so that he can have a look at it too.
This warning feature got disabled in
commit 7fb0e07ec3f7c5f6514523085dbe02ea6b8933e2 [1], which refactored a lot of the depending code of check_subnet_conflict(). We would need to fix get_default_gateway() again. And further figure out what the reason for all those false positives.
This commit doesn't change any behaviour, as this code is already removed via the #if 0. Hopefully most compilers won't bring in calls to an empty function (which is the current state of check_subnet_conflict() now)
kind regards,
David Sommerseth
[1]
<http://openvpn.git.sourceforge.net/git/gitweb.cgi?p=openvpn/openvpn-testing.git;a=commitdiff;h=7fb0e07ec3f7c5f6514523085dbe02ea6b8933e2>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk7KQbkACgkQDC186MBRfrotHQCfWSA/TXLueXP5+fp3pjlDXBcp f2YAnjRuuc7WbPtT1Mgn+GtZbUC+Ewwp
=k46c
-----END PGP SIGNATURE-----
Hi,
Quoted 3 lines · David Sommerseth
On these platforms (including DragonFly),
get_default_gateway()would in some cases return false. Asget_default_gateway()is defined as a void function, and none of the callers expect a return value -> just return without any value.
ACK. Fallout of the recent Linux / route refactoring, as far as I can see - it's on my to-be-cleaned-up-List for FreeBSD, but having it out of the way already means less patches to send in for me :-)
gert
Signature · 4 lines
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]...-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 6 lines · David Sommerseth
On these platforms (including DragonFly),
get_default_gateway()would in some cases return false. Asget_default_gateway()is defined as a void function, and none of the callers expect a return value -> just return without any value.Signed-off-by David Sommerseth <[email protected]...>
Applied to -testing and -stable master branches
commit 93626f2cf71b4803aa1248a928bfc1ac8c9da18b
Signed-off-by: David Sommerseth <[email protected]...> Acked-by: Gert Doering <[email protected]...>
kind regards,
David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk7KRKUACgkQDC186MBRfroGogCggUMfWYvTxmiiOBRyp+/FcGSL lJAAn3Z79b24KQazk/Rw+7fKKKMe0xmu
=MdL+
-----END PGP SIGNATURE-----