diff options
-rw-r--r-- | etc/inc/interfaces.inc | 2 | ||||
-rwxr-xr-x | usr/local/www/interfaces.php | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index fb7bb9f..165b17d 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -3218,7 +3218,7 @@ function interface_6rd_configure($interface = "wan", $wancfg) { /* if the prefix length is not 32 bits we need to shave bits off from the left of the v4 address. */ $rd6brprefixbin .= substr(sprintf("%032b", hexdec($hexbrv4)), $wancfg['prefix-6rd-v4plen'], 32); /* fill out the rest with 0's */ - $rd6brprefixbin = str_pad($rd6brprefixbin, 128, "0", STR_PAD_RIGHT);; + $rd6brprefixbin = str_pad($rd6brprefixbin, 128, "0", STR_PAD_RIGHT); /* convert the 128 bits for the broker address back into a valid IPv6 address */ $rd6brgw = convert_128bit_to_ipv6($rd6brprefixbin); diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 30fb21f..0189f21 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -521,9 +521,11 @@ if ($_POST['apply']) { break; case "6rd": foreach ($ifdescrs as $ifent => $ifdescr) { - if ($if != $ifent && (($config[interfaces][$ifent]['ipaddrv6'] == $_POST['type6']) || ($config[interfaces][$ifent]['ipaddrv6'] == "6to4")) ) { - $input_errors[] = sprintf(gettext("You can only have one interface configured as %s or 6to4."),$_POST['type6']); - break; + if ($if != $ifent && ($config[interfaces][$ifent]['ipaddrv6'] == $_POST['type6'])) { + if ($config[interfaces][$ifent]['prefix-6rd'] == $_POST['prefix-6rd']) { + $input_errors[] = gettext("You can only have one interface configured in 6rd with same prefix."); + break; + } } } if (in_array($wancfg['ipaddrv6'], array())) @@ -531,8 +533,8 @@ if ($_POST['apply']) { break; case "6to4": foreach ($ifdescrs as $ifent => $ifdescr) { - if ($if != $ifent && (($config[interfaces][$ifent]['ipaddrv6'] == $_POST['type6']) || ($config[interfaces][$ifent]['ipaddrv6'] == "6rd")) ) { - $input_errors[] = sprintf(gettext("You can only have one interface configured as %s or 6rd."),$_POST['type6']); + if ($if != $ifent && ($config[interfaces][$ifent]['ipaddrv6'] == $_POST['type6'])) { + $input_errors[] = sprintf(gettext("You can only have one interface configured as 6to4."),$_POST['type6']); break; } } |