From 23f1419311a75442a64282170eb71aa682f91e01 Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Sat, 31 Oct 2009 20:20:32 +0000 Subject: [PATCH] make sure binding listening sockets to specific addresses. previously msgq accepts connection from any address, which is not good. git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@284 e5f2f494-b856-4b98-b285-d166d9295462 --- src/bin/msgq/msgq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bin/msgq/msgq.c b/src/bin/msgq/msgq.c index a5328dc1c2..2205b075d4 100644 --- a/src/bin/msgq/msgq.c +++ b/src/bin/msgq/msgq.c @@ -1136,9 +1136,10 @@ lsock_open(void) isc_socket_t *sock; isc_sockaddr_t sa; isc_result_t result; + struct in_addr ina; - isc_sockaddr_any(&sa); - isc_sockaddr_setport(&sa, msgq_port); + RUNTIME_CHECK(inet_pton(AF_INET, addrs[i], &ina) == 1); + isc_sockaddr_fromin(&sa, &ina, msgq_port); sock = NULL; RUNTIME_CHECK(isc_socket_create(socketmgr,