openvpn icon indicating copy to clipboard operation
openvpn copied to clipboard

Add redirect-gateway/redirect-private to script environment

Open AndersBlomdell opened this issue 8 years ago • 1 comments

While trying to get NetworkManager to obey the "push redirect-gateway/redirect-private" in the "--up"-script, I found that this was impossible since these commands were not visible in the environment. This is a first iteration trying to fix this.

Since "redirect_gateway=" was already part of the environment, the new environment variables are named "redirect_gateway_cmd/redirect_private_cmd"

AndersBlomdell avatar Nov 28 '16 16:11 AndersBlomdell

It might also make sense to change the code in options.c to validate that flags are compatible, e.g it's not clear from the documentation that the following directives are equivalent:

"redirect-private ipv6" == "redirect-gateway !ipv4 ipv6" "redirect-private" == "redirect-gateway !ipv4"

AndersBlomdell avatar Nov 29 '16 08:11 AndersBlomdell

It might also make sense to change the code in options.c to validate that flags are compatible, e.g it's not clear from the documentation that the following directives are equivalent:

"redirect-private ipv6" == "redirect-gateway !ipv4 ipv6" "redirect-private" == "redirect-gateway !ipv4"

I don't think the above are equivalent. How did you conclude so?

Other than that it seems you want to extend the environment variable just for debugging purposes. I don't think this is a good idea.

If still interested in having this change reviewed, please send your patch to the mailing list, so that a broader audience can comment and have a look. Thanks!

ordex avatar Sep 17 '22 19:09 ordex