diff options
author | James Yonan <james@openvpn.net> | 2011-02-18 17:48:25 +0000 |
---|---|---|
committer | James Yonan <james@openvpn.net> | 2011-02-18 17:48:25 +0000 |
commit | 581bef87088ed2c559f66552088166903cf0098d (patch) | |
tree | 95edc1ac3d755e4de04a6cb6a5c6e7a1fe5173ca /push.c | |
parent | 7ae5fb20d7dc52641ef853b896dffc0f283d16d2 (diff) | |
download | openvpn-581bef87088ed2c559f66552088166903cf0098d.tar.gz openvpn-581bef87088ed2c559f66552088166903cf0098d.tar.xz openvpn-581bef87088ed2c559f66552088166903cf0098d.zip |
Added "client-nat" option for stateless, one-to-one
NAT on the client side.
Version 2.1.3i.
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@6944 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'push.c')
-rw-r--r-- | push.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -185,7 +185,7 @@ send_push_reply (struct context *c) struct push_entry *e = c->options.push_list.head; bool multi_push = false; static char cmd[] = "PUSH_REPLY"; - const int extra = 64; /* extra space for possible trailing ifconfig and push-continuation */ + const int extra = 84; /* extra space for possible trailing ifconfig and push-continuation */ const int safe_cap = BCAP (&buf) - extra; buf_printf (&buf, cmd); @@ -218,9 +218,16 @@ send_push_reply (struct context *c) } if (c->c2.push_ifconfig_defined && c->c2.push_ifconfig_local && c->c2.push_ifconfig_remote_netmask) - buf_printf (&buf, ",ifconfig %s %s", - print_in_addr_t (c->c2.push_ifconfig_local, 0, &gc), - print_in_addr_t (c->c2.push_ifconfig_remote_netmask, 0, &gc)); + { + in_addr_t ifconfig_local = c->c2.push_ifconfig_local; +#ifdef ENABLE_CLIENT_NAT + if (c->c2.push_ifconfig_local_alias) + ifconfig_local = c->c2.push_ifconfig_local_alias; +#endif + buf_printf (&buf, ",ifconfig %s %s", + print_in_addr_t (ifconfig_local, 0, &gc), + print_in_addr_t (c->c2.push_ifconfig_remote_netmask, 0, &gc)); + } if (multi_push) buf_printf (&buf, ",push-continuation 1"); |