server: set tcp port and bind address before init 95/5595/2
authorAntonio Borneo <borneo.antonio@gmail.com>
Mon, 20 Apr 2020 21:54:38 +0000 (23:54 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 2 May 2020 14:40:57 +0000 (15:40 +0100)
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
src/server/gdb_server.c
src/server/server.c
src/server/tcl_server.c
src/server/telnet_server.c

index 6f326fe245bdccdc4f58f0d3693aba937616fc6b..f9fe4c293d49aa879b9015930d20777ef86a65a5 100644 (file)
@@ -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. "
index f32a9c76f5e1d85074cfcf2f80811d93409577f8..07b7ae48784a5aed19b33f5905c20dc02b19ba7e 100644 (file)
@@ -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",
index 1735c43ffe60bcab7eef951a5599df38916ea7a9..1ecb827a1ab007325d9ec5fa4c41c5b6f20eadbc 100644 (file)
@@ -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'.",
index a864f5fd293ea5d520b42f89052c95aab60a821a..bfabae833313af52591ec181eede445261be26ce 100644 (file)
@@ -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'.",

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)