[Libguestfs] [PATCH] appliance: Disable ipv6 in the appliance because qemu usernet is ipv4 only

Olaf Hering olaf at aepfle.de
Thu Jan 23 22:44:52 UTC 2014


Signed-off-by: Olaf Hering <olaf at aepfle.de>
---

Untested in this environment.

 appliance/init | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/appliance/init b/appliance/init
index b25ea26..cc8c978 100755
--- a/appliance/init
+++ b/appliance/init
@@ -71,6 +71,10 @@ for f in /sys/block/{h,s,ub,v}d*/queue/scheduler; do echo noop > $f; done
 # Update the system clock.
 hwclock -u -s
 
+# Disable ipv6 because host names resolve to ipv4 and ipv6
+# Resolver may prefer ipv6 and qemu usernet does only ipv4
+for f in /proc/sys/net/ipv6/conf/*/disable_ipv6; do if test -w $f ; then echo 1 > $f; fi; done
+
 # Set up the network.
 ip addr add 127.0.0.1/8 brd + dev lo scope host
 ip link set dev lo up




More information about the Libguestfs mailing list