aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSelva Nair2020-02-20 22:00:28 -0500
committerGert Doering2020-05-13 16:16:36 +0200
commit38b46e6bf65489c2c5d75da1c02a3a1c33e6da88 (patch)
treea84b76c3523c2d64aed47c98954c294dac718c84 /src
parentcab48ad43eaba51c54fa23e55b0b2eb436dd921f (diff)
downloadopenvpn-38b46e6bf65489c2c5d75da1c02a3a1c33e6da88.zip
openvpn-38b46e6bf65489c2c5d75da1c02a3a1c33e6da88.tar.gz
Persist management-query-remote and proxy prompts
Currently this prompt is only output once, not re-written to the management interface when the management client connects. It is thus not seen by a client that connects after the prompt is output or one that disconnects and reconnects. This leads to a deadlock: the daemon waiting for the "remote" command from the client, the latter not aware of it. Resolve by adding the ">REMOTE" and ">PROXY" prompt to man.persist.special_state_msg as done for other persisted prompts such as ">PASSWORD" Signed-off-by: Selva Nair <selva.nair@gmail.com> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <1582254028-7763-1-git-send-email-selva.nair@gmail.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19497.html Signed-off-by: Gert Doering <gert@greenie.muc.de> (cherry picked from commit 93ba6ccddafcc87f336f50dadde144ea4f6178ad)
Diffstat (limited to 'src')
-rw-r--r--src/openvpn/init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index 8bac74f..e153682 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -269,6 +269,7 @@ ce_management_query_proxy(struct context *c)
buf_printf(&out, ">PROXY:%u,%s,%s", (l ? l->current : 0) + 1,
(proto_is_udp(ce->proto) ? "UDP" : "TCP"), np(ce->remote));
management_notify_generic(management, BSTR(&out));
+ management->persist.special_state_msg = BSTR(&out);
}
ce->flags |= CE_MAN_QUERY_PROXY;
while (ce->flags & CE_MAN_QUERY_PROXY)
@@ -280,6 +281,7 @@ ce_management_query_proxy(struct context *c)
break;
}
}
+ management->persist.special_state_msg = NULL;
gc_free(&gc);
}
@@ -349,6 +351,7 @@ ce_management_query_remote(struct context *c)
buf_printf(&out, ">REMOTE:%s,%s,%s", np(ce->remote), ce->remote_port,
proto2ascii(ce->proto, ce->af, false));
management_notify_generic(management, BSTR(&out));
+ management->persist.special_state_msg = BSTR(&out);
ce->flags &= ~(CE_MAN_QUERY_REMOTE_MASK << CE_MAN_QUERY_REMOTE_SHIFT);
ce->flags |= (CE_MAN_QUERY_REMOTE_QUERY << CE_MAN_QUERY_REMOTE_SHIFT);
@@ -362,6 +365,7 @@ ce_management_query_remote(struct context *c)
break;
}
}
+ management->persist.special_state_msg = NULL;
}
gc_free(&gc);