Fixes for redhat IPv6 support
authorJamie Cameron <jcameron@webmin.com>
Thu, 20 Jan 2011 01:49:04 +0000 (17:49 -0800)
committerJamie Cameron <jcameron@webmin.com>
Thu, 20 Jan 2011 01:49:04 +0000 (17:49 -0800)
net/CHANGELOG
net/net-lib.pl
net/redhat-linux-lib.pl

index 5abed0e..2a6ee20 100644 (file)
@@ -56,4 +56,4 @@ Updated bonding support to use the new format in Debian 5.0, thanks to Caspar Sm
 Added a field for editing the MAC address to apply at boot time on Redhat and Debian-based systems.
 Include hostname configuration files in backups, thanks to Caspar Smit.
 ---- Changes since 1.530 ----
-Static IPv6 addresses on Linux systems can now be viewed and managed.
+Static IPv6 addresses on Redhat, CentOS, Fedora, Debian and Ubuntu Linux systems can now be viewed and managed.
index bddfe2e..1b1d5f4 100755 (executable)
@@ -359,7 +359,7 @@ sub check_netmask
   local($ret);
   
   # Detect IP address type (V4, V6) and check syntax accordingly
-  if ( &is_ipv6_address($address)  ) {
+  if ( &check_ip6address($address)  ) {
     $ret=&check_ip6netmask($netmask);
   }
   
index b13a6b2..c8155f1 100755 (executable)
@@ -172,6 +172,9 @@ else {
                push(@ip6s, $b->{'address6'}->[$i]."/".
                            $b->{'netmask6'}->[$i]);
                }
+       if (@ip6s && lc($conf{'IPV6INIT'}) ne 'yes') {
+               $conf{'IPV6INIT'} = 'yes';
+               }
        $conf{'IPV6ADDR'} = shift(@ip6s);
        $conf{'IPV6ADDR_SECONDARIES'} = join(" ", @ip6s);
        }
@@ -182,6 +185,18 @@ if (-d &translate_filename($devices_dir)) {
                   "$devices_dir/ifcfg-$name");
        }
 &unlock_file("$net_scripts_dir/ifcfg-$name");
+
+# Make sure IPv6 is enabled globally
+if (@{$b->{'address6'}}) {
+       local %conf;
+       &lock_file($network_config);
+       &read_env_file($network_config, \%conf);
+       if (lc($conf{'NETWORKING_IPV6'}) ne 'yes') {
+               $conf{'NETWORKING_IPV6'} = 'yes';
+               &write_env_file($network_config, \%conf);
+               }
+       &unlock_file($network_config);
+       }
 }
 
 # delete_interface(&details)