diff --git a/htools/Ganeti/Confd/Server.hs b/htools/Ganeti/Confd/Server.hs index 743f54dcb639b9b7b7862d45e4f3b2024ac3840c..9c38bdb77fd719823d0327e371910bfecbd953d3 100644 --- a/htools/Ganeti/Confd/Server.hs +++ b/htools/Ganeti/Confd/Server.hs @@ -6,7 +6,7 @@ {- -Copyright (C) 2011 Google Inc. +Copyright (C) 2011, 2012 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -51,6 +51,7 @@ import Ganeti.Confd import Ganeti.Config import Ganeti.Hash import Ganeti.Logging +import Ganeti.BasicTypes import qualified Ganeti.Constants as C -- * Types and constants definitions @@ -502,9 +503,10 @@ listener s hmac resp = do -- | Main function. main :: DaemonOptions -> IO () main opts = do - s <- S.socket S.AF_INET S.Datagram S.defaultProtocol - let port = maybe C.defaultConfdPort fromIntegral $ optPort opts - S.bindSocket s (S.SockAddrInet (fromIntegral port) S.iNADDR_ANY) + parseresult <- parseAddress opts C.defaultConfdPort + (af_family, bindaddr) <- exitIfBad parseresult + s <- S.socket af_family S.Datagram S.defaultProtocol + S.bindSocket s bindaddr cref <- newIORef (Bad "Configuration not yet loaded") statemvar <- newMVar initialState hmac <- getClusterHmac diff --git a/htools/hconfd.hs b/htools/hconfd.hs index 1ac173e2903a8392e14edf63190b9497ddb7ae29..d544a6c78d579439850ab0c1b0983f846859caa8 100644 --- a/htools/hconfd.hs +++ b/htools/hconfd.hs @@ -4,7 +4,7 @@ {- -Copyright (C) 2009, 2011 Google Inc. +Copyright (C) 2009, 2011, 2012 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -39,6 +39,7 @@ options = , oNoUserChecks , oDebug , oPort C.defaultConfdPort + , oBindAddress ] -- | Main function.