aboutsummaryrefslogtreecommitdiff
path: root/src/server/tcl_server.c
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2020-04-20 23:54:38 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2020-05-02 15:40:57 +0100
commitebc28710051402e38a4743dfde20f1d1c2f7a875 (patch)
tree0ac0b023aa694d9fb0dc42081c4ab91ec89fddfd /src/server/tcl_server.c
parent837de9fd10e93dc369c02dd1d28c526fd1ba1ed4 (diff)
downloadriscv-openocd-ebc28710051402e38a4743dfde20f1d1c2f7a875.zip
riscv-openocd-ebc28710051402e38a4743dfde20f1d1c2f7a875.tar.gz
riscv-openocd-ebc28710051402e38a4743dfde20f1d1c2f7a875.tar.bz2
server: set tcp port and bind address before init
All the servers open the listening socket during openocd "init"; it's not possible to change the tcp port or the bind address after "init". In current code, the call order during "init" permits to change the port and bind address of tcl and telnet server if the related command is issued after "init" in the same script or on openocd command line. This is not guaranteed to work if the call order during "init" changes, so it's incorrect. Change the commands "bindto" and "*_port" to COMMAND_CONFIG. Change-Id: Id88f225a67a872b4bcaf3b799466bddedc248015 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reported-by: Christopher Head <chead@zaber.com> Fixes: https://sourceforge.net/p/openocd/tickets/264/ Reviewed-on: http://openocd.zylin.com/5595 Reviewed-by: Christopher Head <chead@zaber.com> Tested-by: jenkins
Diffstat (limited to 'src/server/tcl_server.c')
-rw-r--r--src/server/tcl_server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/tcl_server.c b/src/server/tcl_server.c
index 1735c43..1ecb827 100644
--- a/src/server/tcl_server.c
+++ b/src/server/tcl_server.c
@@ -331,7 +331,7 @@ static const struct command_registration tcl_command_handlers[] = {
{
.name = "tcl_port",
.handler = handle_tcl_port_command,
- .mode = COMMAND_ANY,
+ .mode = COMMAND_CONFIG,
.help = "Specify port on which to listen "
"for incoming Tcl syntax. "
"Read help on 'gdb_port'.",