diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-07-25 12:47:48 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-07-25 12:48:17 -0300 |
commit | f3d8851136156c14fbce86489f99043bf20423a6 (patch) | |
tree | 0d7f3ad2b34b2b19007ed94fb773950b0b1f6d7a /usr/local | |
parent | 75de6b295a11ca28cc445346cd1808bd76f281e3 (diff) | |
download | pfsense-f3d8851136156c14fbce86489f99043bf20423a6.zip pfsense-f3d8851136156c14fbce86489f99043bf20423a6.tar.gz |
Fix #3575, do not allow user to set IPs for GRE interfaces on interface edit page.
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/interfaces.php | 6 | ||||
-rw-r--r-- | usr/local/www/interfaces_assign.php | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 127486a..2aadb71 100644 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -102,6 +102,8 @@ foreach ($a_ppps as $pppid => $ppp) { break; } +$type_disabled = (substr($wancfg['if'], 0, 3) == 'gre') ? 'disabled="disabled"' : ''; + if ($wancfg['if'] == $a_ppps[$pppid]['if']) { $pconfig['pppid'] = $pppid; $pconfig['ptpid'] = $a_ppps[$pppid]['ptpid']; @@ -1584,7 +1586,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), <tr> <td valign="middle" class="vncell"><strong><?=gettext("IPv4 Configuration Type"); ?></strong></td> <td class="vtable"> - <select name="type" onchange="updateType(this.value);" class="formselect" id="type"> + <select name="type" onchange="updateType(this.value);" <?php echo $type_disabled; ?> class="formselect" id="type"> <?php foreach ($types4 as $key => $opt) { echo "<option onclick=\"updateType('{$key}');\""; @@ -1600,7 +1602,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), <tr> <td valign="middle" class="vncell"><strong><?=gettext("IPv6 Configuration Type"); ?></strong></td> <td class="vtable"> - <select name="type6" onchange="updateTypeSix(this.value);" class="formselect" id="type6"> + <select name="type6" onchange="updateTypeSix(this.value);" <?php echo $type_disabled; ?> class="formselect" id="type6"> <?php foreach ($types6 as $key => $opt) { echo "<option onclick=\"updateTypeSix('{$key}');\""; diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php index 6e82f64..5dedb5c 100644 --- a/usr/local/www/interfaces_assign.php +++ b/usr/local/www/interfaces_assign.php @@ -239,6 +239,13 @@ if ($_POST['apply']) { if (isset($portlist[$ifport]['isppp'])) $config['interfaces'][$ifname]['ipaddr'] = $portlist[$ifport]['type']; + if (substr($ifport, 0, 3) == 'gre') { + unset($config['interfaces'][$ifname]['ipaddr']); + unset($config['interfaces'][$ifname]['subnet']); + unset($config['interfaces'][$ifname]['ipaddrv6']); + unset($config['interfaces'][$ifname]['subnetv6']); + } + /* check for wireless interfaces, set or clear ['wireless'] */ if (preg_match($g['wireless_regex'], $ifport)) { if (!is_array($config['interfaces'][$ifname]['wireless'])) |