[Openvpn-devel,v2,4/4] Do not set pool netmask when nopool is set

Message ID 20191113100702.6863-4-tom.ty89@gmail.com
State Changes Requested
Headers show
Series [Openvpn-devel,v2,1/4] Avoid repeating code for tap and tun+subnet in server directive | expand

Commit Message

Tom Yan Nov. 12, 2019, 11:07 p.m. UTC
The setting probably just slipped out of the if-block over rewrites.
---
 src/openvpn/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gert Doering June 22, 2020, 8:45 p.m. UTC | #1
Hi,

On Wed, Nov 13, 2019 at 06:07:02PM +0800, Tom Yan wrote:
> The setting probably just slipped out of the if-block over rewrites.

Possibly... so it makes sense to clean this up.

Can you please re-send the patch to change *both* places where this
occurs, helper.c line 348 and helper.c line 391?  Seems a bit weird to
just change one occurance.

gert

Patch

diff --git a/src/openvpn/helper.c b/src/openvpn/helper.c
index 6e2f0891..a36bc63a 100644
--- a/src/openvpn/helper.c
+++ b/src/openvpn/helper.c
@@ -351,8 +351,8 @@  helper_client_server(struct options *o)
                 o->ifconfig_pool_start = o->server_network + ptp + 1;
                 o->ifconfig_pool_end = (o->server_network | ~o->server_netmask) - ptp;
                 ifconfig_pool_verify_range(M_USAGE, o->ifconfig_pool_start, o->ifconfig_pool_end);
+                o->ifconfig_pool_netmask = o->server_netmask;
             }
-            o->ifconfig_pool_netmask = o->server_netmask;
 
             push_option(o, print_opt_route_gateway(o->server_network + ptp, &o->gc), M_USAGE);
             if (dev == DEV_TYPE_TUN && !o->route_default_gateway)