diff options
author | Paul Fertser <fercerpav@gmail.com> | 2018-01-13 16:22:10 +0300 |
---|---|---|
committer | Paul Fertser <fercerpav@gmail.com> | 2018-03-18 12:59:43 +0000 |
commit | 828ee07657914212f81152a768a8ec43bb73db03 (patch) | |
tree | 7c365f5e60adfc5055778cdde954762dbcb32778 /src | |
parent | ffd6b78a2c47d1c15629dc72c71caea30ef8161a (diff) | |
download | riscv-openocd-828ee07657914212f81152a768a8ec43bb73db03.zip riscv-openocd-828ee07657914212f81152a768a8ec43bb73db03.tar.gz riscv-openocd-828ee07657914212f81152a768a8ec43bb73db03.tar.bz2 |
server: bind to IPv4 localhost by default
Since OpenOCD basically allows to perform arbitrary actions on behalf of
the running user, it makes sense to restrict the exposure by default.
If you need network connectivity and your environment is safe enough,
use "bindto 0.0.0.0" to switch to the old behaviour.
Change-Id: I4a4044b90d0ecb30118cea96fc92a7bcff0924e0
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/4331
Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Diffstat (limited to 'src')
-rw-r--r-- | src/server/server.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/server.c b/src/server/server.c index 8fd2d71..4e80656 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) { |