Skip to content

Commit

Permalink
Merge pull request #918 from jeromemaloberti/CA-89303
Browse files Browse the repository at this point in the history
  • Loading branch information
xen-git committed Nov 22, 2012
2 parents 0817d46 + 98ade60 commit 4baae9e
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions ocaml/xapi/xapi_mgmt_iface.ml
Expand Up @@ -49,25 +49,23 @@ let stop () =
* the pool master. *) * the pool master. *)
let start ~__context ?addr () = let start ~__context ?addr () =
debug "Starting new server"; debug "Starting new server";
let localhost = Helpers.get_localhost ~__context in let addr, socket =
let ipv6_pifs = Db.PIF.get_records_where ~__context match addr with
~expr:( | None ->
And ( begin
Not (Eq (Field "ipv6_configuration_mode", Literal "None")), try (* Is it IPv6 ? *)
Eq (Field "host", Literal (Ref.string_of localhost)) let addr = Unix.inet6_addr_any in
) addr, Xapi_http.bind (Unix.ADDR_INET(addr, Xapi_globs.http_port))
) in with _ -> (* No. *)
let pif_address_type = if ipv6_pifs = [] then `IPv4 else `IPv6 in let addr = Unix.inet_addr_any in
let addr = addr, Xapi_http.bind (Unix.ADDR_INET(addr, Xapi_globs.http_port))
match addr, pif_address_type with end
| None, `IPv4 -> Unix.inet_addr_any | Some ip ->
| None, `IPv6 -> Unix.inet6_addr_any debug "Starting new server (listening on HIMN only: %s)" ip;
| Some ip, _ -> himn_only := true;
debug "Starting new server (listening on HIMN only: %s)" ip; let addr = Unix.inet_addr_of_string ip in
himn_only := true; addr, Xapi_http.bind (Unix.ADDR_INET(addr, Xapi_globs.http_port))
Unix.inet_addr_of_string ip
in in
let socket = Xapi_http.bind (Unix.ADDR_INET(addr, Xapi_globs.http_port)) in
Http_svr.start Xapi_http.server socket; Http_svr.start Xapi_http.server socket;
management_interface_server := Some socket; management_interface_server := Some socket;


Expand Down

0 comments on commit 4baae9e

Please sign in to comment.