When the bindto command is issued after the init command, it is accepted and appears to change the ports for the Telnet and TCL RPC interfaces, but not the GDB port. This doesn’t seem to be documented and certainly seems unexpected. I don’t know if it’s expected to be rejected after init or if it’s expected to work right?
It's a bug!
The sockets for gdb, telnet and tcl are all created during the init phase. For a matter of call order, the tcl and telnet ports are open after the parse of the config file, so after init and bindto if they are inside the config file.
But if you start openocd without bindto, wait for telnet port to open, telnet and type bindto, it has no effect anymore.
There are other similar crap. I'm preparing a fix
http://openocd.zylin.com/5595 fixes it by allowing the commands during config only