Hi, On Sun, Jun 07, 2020 at 01:25:01PM +0200, Gert Doering wrote: > Can we make this conditional in a way that does not break "redirect-private"?
A very simple patch would be
if (streq(p[0], "redirect-gateway"))
{
options->routes->flags |= RG_REROUTE_GW;
}
+ if (streq(p[0], "redirect-private"))
+ {
+ options->routes->flags |= RG_ENABLE;
+ }
and then take your patch as-is ("redirect-gateway with no options" would
set RG_REROUTE_GW, which, if not cleared by !ipv4, would set RG_ENABLE
later on, while "redirect-private" sets the RG_ENABLE itself).
Alternatively, set RG_ENABLE at the top (always), and clear it for "!ipv4"
else if (streq(p[j], "!ipv4"))
{
options->routes->flags &= ~(RG_REROUTE_GW|RG_ENABLE);
}
... this should do the same thing, with less code convolutions.
Configs that have *both* "redirect-private" and "redirect-gateway !ipv4 ipv6"
would still be broken. But I'm not sure such a config is well-defined
in the first place.
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 [email protected]
signature.asc
Description: PGP signature
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
