This is an automated email from Gerrit.

Antonio Borneo ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/5595

-- gerrit

commit 7d54996570c138d5ce4c49a1debe043f1255aada
Author: Antonio Borneo <[email protected]>
Date:   Mon Apr 20 23:54:38 2020 +0200

    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 <[email protected]>
    Reported-by: Christopher Head <[email protected]>
    Fixes: https://sourceforge.net/p/openocd/tickets/264/

diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index 6f326fe..f9fe4c2 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -3739,7 +3739,7 @@ static const struct command_registration 
gdb_command_handlers[] = {
        {
                .name = "gdb_port",
                .handler = handle_gdb_port_command,
-               .mode = COMMAND_ANY,
+               .mode = COMMAND_CONFIG,
                .help = "Normally gdb listens to a TCP/IP port. Each subsequent 
GDB "
                        "server listens for the next port number after the "
                        "base port number specified. "
diff --git a/src/server/server.c b/src/server/server.c
index f32a9c7..07b7ae4 100644
--- a/src/server/server.c
+++ b/src/server/server.c
@@ -799,7 +799,7 @@ static const struct command_registration 
server_command_handlers[] = {
        {
                .name = "bindto",
                .handler = &handle_bindto_command,
-               .mode = COMMAND_ANY,
+               .mode = COMMAND_CONFIG,
                .usage = "[name]",
                .help = "Specify address by name on which to listen for "
                        "incoming TCP/IP connections",
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'.",
diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c
index a864f5f..bfabae8 100644
--- a/src/server/telnet_server.c
+++ b/src/server/telnet_server.c
@@ -705,7 +705,7 @@ static const struct command_registration 
telnet_command_handlers[] = {
        {
                .name = "telnet_port",
                .handler = handle_telnet_port_command,
-               .mode = COMMAND_ANY,
+               .mode = COMMAND_CONFIG,
                .help = "Specify port on which to listen "
                        "for incoming telnet connections.  "
                        "Read help on 'gdb_port'.",

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to