Skip to contentSkip to conversation

Fix FreeBSD-specific mishandling of gc arena pointer in create_arbitrary_remote()

PATCH In review Gert Doering 2 participants 3 messages Nov 10, 2015 – Nov 24, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix FreeBSD-specific mishandling of gc arena pointer in create_arbitrary_remote()

... and while at it, fix warning about losing "const" qualifier on return.

---
 src/openvpn/tun.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/openvpn/tun.c +2 -2
index 24a61ec..6679330 100644
@@ -641,7 +641,7 @@ void delete_route_connected_v6_net(struct tuntap * tt,
  * is still point to point and no layer 2 resolution is done...
  */
 
-char *
+const char *
 create_arbitrary_remote( struct tuntap *tt, struct gc_arena * gc )
 {
   in_addr_t remote;
@@ -650,7 +650,7 @@ create_arbitrary_remote( struct tuntap *tt, struct gc_arena * gc )
 
   if ( remote == tt->local ) remote ++;
 
-  return print_in_addr_t (remote, 0, &gc);
+  return print_in_addr_t (remote, 0, gc);
 }
 #endif
 
Signature · 1 line
2.6.1
#1 lore raw
Quoted 22 lines · Gert Doering

... and while at it, fix warning about losing "const" qualifier on return.

---
 src/openvpn/tun.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/openvpn/tun.c +1 -1
index 24a61ec..6679330 100644
@@ -641,7 +641,7 @@ void delete_route_connected_v6_net(struct tuntap * tt,
  * is still point to point and no layer 2 resolution is done...
  */
 
-char *
+const char *
 create_arbitrary_remote( struct tuntap *tt, struct gc_arena * gc )
 {
   in_addr_t remote;

src/openvpn/tun.c create_arbitrary_remote( struct tuntap *tt, struct gc_arena * gc )

Quoted 9 lines
src/openvpn/tun.c +1 -2
@@ -650,7 +650,7 @@ create_arbitrary_remote( struct tuntap *tt, struct gc_arena * gc )
 
   if ( remote == tt->local ) remote ++;
 
-  return print_in_addr_t (remote, 0, &gc);
+  return print_in_addr_t (remote, 0, gc);
 }
 #endif
 
--

ACK (how can this have ever worked...?)

-Steffan

#2 lore raw
In reply to Gert Doering

Patch has been applied to the master and release/2.3 branch.

commit b33e1355765bbf83f4c8b744c442c7d98df808fa (master) commit 66a34601ecef2a099403468d239ea3f9b3a3b970 (release/2.3)

Author: Gert Doering
Date:   Tue Nov 10 22:17:03 2015 +0100
     Fix FreeBSD-specific mishandling of gc arena pointer in create_arbitrary_remote()

     Signed-off-by: Gert Doering <[email protected]...>
     Acked-by: Steffan Karger <[email protected]...>
     Message-Id: <[email protected]...>

--
kind regards,

Gert Doering