aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/openocd.texi8
-rw-r--r--src/server/server.c2
2 files changed, 6 insertions, 4 deletions
diff --git a/doc/openocd.texi b/doc/openocd.texi
index 6362b41f..73d64b3d 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -7132,9 +7132,11 @@ the initial log output channel is stderr.
Add @var{directory} to the file/script search path.
@end deffn
-@deffn Command bindto [name]
-Specify address by name on which to listen for incoming TCP/IP connections.
-By default, OpenOCD will listen on all available interfaces.
+@deffn Command bindto [@var{name}]
+Specify hostname or IPv4 address on which to listen for incoming
+TCP/IP connections. By default, OpenOCD will listen on the loopback
+interface only. If your network environment is safe, @code{bindto
+0.0.0.0} can be used to cover all available interfaces.
@end deffn
@anchor{targetstatehandling}
diff --git a/src/server/server.c b/src/server/server.c
index 8fd2d71d..4e806563 100644
--- a/src/server/server.c
+++ b/src/server/server.c
@@ -259,7 +259,7 @@ int add_service(char *name,
c->sin.sin_family = AF_INET;
if (bindto_name == NULL)
- c->sin.sin_addr.s_addr = INADDR_ANY;
+ c->sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
else {
hp = gethostbyname(bindto_name);
if (hp == NULL) {