diff --git a/ChangeLog b/ChangeLog index b161884ac4..06fc0db75c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ + 53. [bug] zhanglikun + bin/bindctl: Generate a unique session ID by using + socket.gethostname() instead of socket.gethostbyname(), + since the latter one could make bindctl stall if its own + host name can't be resolved. + (Trac #228, svn r2096) + 52. [func] zhanglikun bin/xfrout: When xfrout is launched, check whether the socket file is being used by one running xfrout process, diff --git a/src/bin/bindctl/bindcmd.py b/src/bin/bindctl/bindcmd.py index 8b63da96e5..138024f05f 100644 --- a/src/bin/bindctl/bindcmd.py +++ b/src/bin/bindctl/bindcmd.py @@ -87,8 +87,8 @@ class BindCmdInterpreter(Cmd): '''Generate one session id for the connection. ''' rand = os.urandom(16) now = time.time() - ip = socket.gethostbyname(socket.gethostname()) - session_id = sha1(("%s%s%s" %(rand, now, ip)).encode()) + session_id = sha1(("%s%s%s" %(rand, now, + socket.gethostname())).encode()) digest = session_id.hexdigest() return digest