@@ -323,6 +323,9 @@ module Interface = struct
323323
324324 let set_ipv6_conf _ dbg ~name ~conf =
325325 Debug. with_thread_associated dbg (fun () ->
326+ if Proc. get_ipv6_disabled () then
327+ warn " Not configuring IPv6 address for %s (IPv6 is disabled)" name
328+ else begin
326329 debug " Configuring IPv6 address for %s: %s" name (conf |> Rpcmarshal. marshal typ_of_ipv6 |> Jsonrpc. to_string);
327330 update_config name {(get_config name) with ipv6_conf = conf};
328331 match conf with
@@ -371,6 +374,7 @@ module Interface = struct
371374 let add_addrs = Xapi_stdext_std.Listext.List. set_difference addrs cur_addrs in
372375 List. iter (Ip. del_ip_addr name) rm_addrs;
373376 List. iter (Ip. set_ip_addr name) add_addrs
377+ end
374378 ) ()
375379
376380 let get_ipv6_gateway _ dbg ~name =
@@ -385,13 +389,17 @@ module Interface = struct
385389
386390 let set_ipv6_gateway _ dbg ~name ~address =
387391 Debug. with_thread_associated dbg (fun () ->
392+ if Proc. get_ipv6_disabled () then
393+ warn " Not configuring IPv6 gateway for %s (IPv6 is disabled)" name
394+ else begin
388395 debug " Configuring IPv6 gateway for %s: %s" name (Unix. string_of_inet_addr address);
389396 update_config name {(get_config name) with ipv6_gateway = Some address};
390397 if ! config.gateway_interface = None || ! config.gateway_interface = Some name then begin
391398 debug " %s is the default gateway interface" name;
392399 Ip. set_gateway name address
393400 end else
394401 debug " %s is NOT the default gateway interface" name
402+ end
395403 ) ()
396404
397405 let set_ipv4_routes _ dbg ~name ~routes =
0 commit comments