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
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user