summaryrefslogtreecommitdiff
path: root/app/openvpn/src/openvpn/push.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/openvpn/src/openvpn/push.c')
-rw-r--r--app/openvpn/src/openvpn/push.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/app/openvpn/src/openvpn/push.c b/app/openvpn/src/openvpn/push.c
index 028d838e..c7844499 100644
--- a/app/openvpn/src/openvpn/push.c
+++ b/app/openvpn/src/openvpn/push.c
@@ -303,9 +303,17 @@ send_push_reply (struct context *c)
if (multi_push)
buf_printf (&buf, ",push-continuation 1");
- /* Send session_id if client supports it */
- if (c->c2.tls_multi->peer_info && strstr(c->c2.tls_multi->peer_info, "IV_PROTO=2")) {
- buf_printf(&buf, ",session_id %d", c->c2.tls_multi->vpn_session_id);
+ /* Send peer-id if client supports it */
+ if (c->c2.tls_multi->peer_info)
+ {
+ const char* proto_str = strstr(c->c2.tls_multi->peer_info, "IV_PROTO=");
+ if (proto_str)
+ {
+ int proto = 0;
+ int r = sscanf(proto_str, "IV_PROTO=%d", &proto);
+ if ((r == 1) && (proto >= 2))
+ buf_printf(&buf, ",peer-id %d", c->c2.tls_multi->peer_id);
+ }
}
if (BLEN (&buf) > sizeof(cmd)-1)