[Openvpn-devel,v1] PUSH_UPDATE server: update reporting_addr after ifconfig update
Commit Message
From: Marco Baffo <marco@mandelbit.com>
Update mi->reporting_addr(_ipv6) for staus reporting purposes
after sending a PUSH_UPDATE containing an ifconfig(-ipv6) option.
Github: fixes OpenVPN/openvpn#889
Change-Id: Ie15977b44091445b9d1edebe885d92ec5cb5770a
Signed-off-by: Marco Baffo <marco@mandelbit.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1340
---
This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1340
This mail reflects revision 1 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <gert@greenie.muc.de>
@@ -4346,6 +4346,7 @@
multi_unlearn_in_addr_t(m, mi, old_addr);
mi->context.c2.push_ifconfig_defined = false;
mi->context.c2.push_ifconfig_local = 0;
+ mi->reporting_addr = 0;
}
/* Function to unlearn previous ifconfig-ipv6 of a client in the server multi_context after a PUSH_UPDATE */
@@ -4358,6 +4359,7 @@
multi_unlearn_in6_addr(m, mi, old_addr6);
mi->context.c2.push_ifconfig_ipv6_defined = false;
CLEAR(mi->context.c2.push_ifconfig_ipv6_local);
+ CLEAR(mi->reporting_addr_ipv6);
}
/**
@@ -4389,6 +4391,8 @@
{
mi->context.c2.push_ifconfig_defined = true;
mi->context.c2.push_ifconfig_local = ntohl(new_addr.s_addr);
+ /* set our client's VPN endpoint for status reporting purposes */
+ mi->reporting_addr = mi->context.c2.push_ifconfig_local;
}
}
@@ -4408,6 +4412,8 @@
{
mi->context.c2.push_ifconfig_ipv6_defined = true;
mi->context.c2.push_ifconfig_ipv6_local = new_addr6;
+ /* set our client's VPN endpoint for status reporting purposes */
+ mi->reporting_addr_ipv6 = mi->context.c2.push_ifconfig_ipv6_local;
}
}
}