summaryrefslogtreecommitdiffstats
path: root/network.py
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2007-10-23 20:50:08 +0000
committerDavid Cantrell <dcantrell@redhat.com>2007-10-23 20:50:08 +0000
commitef7b8d3aefe1e5c9962fe4070d0b254f4a755487 (patch)
treeb2fe2b4f2b959a0b8a066191cf08de769a13b05f /network.py
parent3571de7945fa56ae04a7991047a75ccd257e71ae (diff)
downloadanaconda-ef7b8d3aefe1e5c9962fe4070d0b254f4a755487.tar.gz
anaconda-ef7b8d3aefe1e5c9962fe4070d0b254f4a755487.tar.xz
anaconda-ef7b8d3aefe1e5c9962fe4070d0b254f4a755487.zip
* network.py (Network.write): Write out the IPV6* variables to the
ifcfg files correctly, avoid IPV6ADDR=dhcp and other invalid settings (#328931).
Diffstat (limited to 'network.py')
-rw-r--r--network.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/network.py b/network.py
index 117efb713..78d190c50 100644
--- a/network.py
+++ b/network.py
@@ -455,6 +455,21 @@ class Network:
if len(dev.get("DESC")) > 0:
f.write("# %s\n" % (dev.get("DESC"),))
+ # handle IPv6 settings correctly for the ifcfg file
+ ipv6addr = dev.get("IPV6ADDR").lower()
+ ipv6prefix = dev.get("IPV6PREFIX").lower()
+
+ dev.unset('IPV6ADDR')
+ dev.unset('IPV6PREFIX')
+
+ if ipv6addr == 'dhcp':
+ dev.set(('IPV6INIT', 'yes'))
+ elif ipv6addr != '' and ipv6addr is not None:
+ if ipv6prefix != '' and ipv6prefix is not None:
+ dev.set(('IPV6ADDR', ipv6addr + '/' + ipv6prefix))
+ else:
+ dev.set(('IPV6ADDR', ipv6addr))
+
f.write(str(dev))
# write out the hostname as DHCP_HOSTNAME if given (#81613)