Hi,

On Tue, Nov 26, 2024 at 02:26:59PM +0000, Alexander von Gluck via Openvpn-devel 
wrote:
> diff --git a/src/openvpn/route.c b/src/openvpn/route.c
> index fa20d08f..8d319123 100644
> --- a/src/openvpn/route.c
> +++ b/src/openvpn/route.c
> @@ -54,6 +54,12 @@
>  #include <net/route.h>                  /* RT_ROUNDUP(), RT_ADVANCE() */
>  #endif
>  
> +#if defined(TARGET_HAIKU)
> +#include <SupportDefs.h>    /* uint32, etc */
> +#include <net/if.h>         /* ifconf etc */
> +#include <sys/sockio.h>     /* SIOCGRTTABLE, etc */
> +#endif /* TARGET_HAIKU */
> +

System includes go to "syshead.h".

>  #ifdef _WIN32
>  #include "openvpn-msg.h"
>  
> @@ -1857,14 +1863,16 @@ add_route(struct route_ipv4 *r,
>  
>      {
>          /* ex: route add /dev/net/ipro1000/0 default gw 192.168.1.1 netmask 
> 255.255.255.0 */
> -        argv_printf(&argv, "route add %s inet default gw %s netmask %s",
> +        argv_printf(&argv, "%s add %s inet %s gw %s netmask %s",
> +                    ROUTE_PATH,
>                      rgi-
> >iface,
> +                    network,

Please squash this part into patch 1/2 - having one patch introduce
something new for #ifdef TARGET_HAIKU, only to have the next patch
modify the very same line is not helpful.

> +#elif defined(TARGET_HAIKU)
> +
> +    {
> +        // route del /dev/net/ipro1000/0 inet 192.168.0.0 gw 192.168.1.1 
> netmask 255.255.0.0

No // comments

At least adding/deleting of routes should be "in patch 1".

The get_default_gateway() part could, technically, go into its own patch
("it adds independent new functionality") - but since this all fairly
small, it can just be part of the single patch.

A few lines of README would be nice, if anything special is needed
to make OpenVPN work on HAIKU, with you patch ("you need to install
the tun/tap driver from $url, then reboot twice at midnight, and
off you go").

gert

-- 
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             g...@greenie.muc.de

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to