Option to disable IPv6 for an interface
authorJamie Cameron <jcameron@webmin.com>
Fri, 21 Jan 2011 01:30:55 +0000 (17:30 -0800)
committerJamie Cameron <jcameron@webmin.com>
Fri, 21 Jan 2011 01:30:55 +0000 (17:30 -0800)
net/edit_bifc.cgi
net/lang/en
net/save_bifc.cgi

index 83c97a8..769291c 100755 (executable)
@@ -155,9 +155,12 @@ if (&supports_address6($b)) {
                }
        $table6 .= &ui_columns_end();
        print &ui_table_row($text{'ifcs_mode6'},
-               &ui_radio_table("mode6", $b->{'auto6'} ? "auto" : "address",
-                       [ [ "auto", $text{'ifcs_auto6'} ],
-                         [ "address", $text{'ifcs_static2'}, $table6 ] ]));
+               &ui_radio_table("mode6",
+                       $b->{'auto6'} ? "auto" :
+                       @{$b->{'address6'}} ? "address" : "none",
+                       [ [ "none", $text{'ifcs_none6'} ],
+                         [ "auto", $text{'ifcs_auto6'} ],
+                         [ "address", $text{'ifcs_static2'}, $table6 ] ]), 2);
        }
 
 # MTU
index f6a7316..5dfaaf0 100644 (file)
@@ -46,6 +46,7 @@ ifcs_mode6=IPv6 addresses
 ifcs_address6=IPv6 address
 ifcs_netmask6=Netmask
 ifcs_mode6a=IPv6 addresses
+ifcs_none6=IPv6 disabled
 
 aifc_create=Create Active Interface
 aifc_edit=Edit Active Interface
index c84ef0a..eab455e 100755 (executable)
@@ -233,6 +233,12 @@ else {
                $b->{'address6'} = \@address6;
                $b->{'netmask6'} = \@netmask6;
                }
+       elsif (&supports_address6($b) && $in{'mode6'} eq 'none') {
+               # IPv6 disabled
+               delete($b->{'address6'});
+               delete($b->{'netmask6'});
+               delete($b->{'auto6'});
+               }
 
        # Save bonding settings
        if ($in{'bond'}) {