interfaces: lock down PPP modes #7446

This change reflects what PPP is actually capable off under
the hood and no functional changes intended.

You could still post a different type but since the goal is
to get rid of posting anything related to PPP this will make
it easier to judge if people actually used this.
This commit is contained in:
Franco Fichtner 2024-08-16 13:33:41 +02:00
parent 37efb1f029
commit b2d9372b0f

View File

@ -1432,26 +1432,40 @@ if (isset($a_interfaces[$if]['wireless'])) {
// Find all possible media options for the interface
$mediaopts_list = legacy_interface_details($pconfig['if'])['supported_media'] ?? [];
$types4 = [
'none' => gettext('None'),
'staticv4' => gettext('Static IPv4'),
'dhcp' => gettext('DHCP'),
'ppp' => gettext('PPP'),
'pppoe' => gettext('PPPoE'),
'pptp' => gettext('PPTP'),
'l2tp' => gettext('L2TP'),
];
$types4 = $types6 = ['none' => gettext('None')];
$types6 = [
'none' => gettext('None'),
'staticv6' => gettext('Static IPv6'),
'dhcp6' => gettext('DHCPv6'),
'pppoev6' => gettext('PPPoEv6'),
'slaac' => gettext('SLAAC'),
'6rd' => gettext('6rd Tunnel'),
'6to4' => gettext('6to4 Tunnel'),
'track6' => gettext('Track Interface')
];
if (!interface_ppps_capable($a_interfaces[$if], $a_ppps)) {
$types4['staticv4'] = gettext('Static IPv4');
$types4['dhcp'] = gettext('DHCP');
$types6['staticv6'] = gettext('Static IPv6');
$types6['dhcp6'] = gettext('DHCPv6');
$types6['slaac'] = gettext('SLAAC');
$types6['6rd'] = gettext('6rd Tunnel');
$types6['6to4'] = gettext('6to4 Tunnel');
$types6['track6'] = gettext('Track Interface');
} else {
switch ($a_ppps[$pppid]['type']) {
case 'ppp':
$types4['ppp'] = gettext('PPP');
break;
case 'pppoe':
$types4['pppoe'] = gettext('PPPoE');
$types6['pppoev6'] = gettext('PPPoEv6');
break;
case 'pptp':
$types4['pptp'] = gettext('PPTP');
break;
case 'l2tp':
$types4['l2tp'] = gettext('L2TP');
break;
default:
break;
}
$types6['dhcp6'] = gettext('DHCPv6');
$types6['slaac'] = gettext('SLAAC');
}
include("head.inc");
?>