From 89a746a94db291cd006e5a615c393e034e145990 Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 14 Nov 2018 08:53:37 -0500 Subject: [PATCH] Remove obsolete OLSRD code. Implements #9117 (cherry picked from commit 592bec817f152a7536572a675079776138827cc8) --- src/etc/inc/services.inc | 25 ------------------- src/etc/inc/system.inc | 24 ++++-------------- src/usr/local/www/services_dhcp.php | 20 --------------- src/usr/local/www/services_dhcpv6.php | 20 --------------- .../www/services_router_advertisements.php | 10 -------- 5 files changed, 5 insertions(+), 94 deletions(-) diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc index e4b70df045..d9f4601c90 100644 --- a/src/etc/inc/services.inc +++ b/src/etc/inc/services.inc @@ -479,19 +479,6 @@ function services_dhcpdv4_configure() { return 0; } - /* if OLSRD is enabled, allow WAN to house DHCP. */ - if (!function_exists('is_package_installed')) { - require_once('pkg-utils.inc'); - } - if (is_package_installed('olsrd') && isset($config['installedpackages']['olsrd'])) { - foreach ($config['installedpackages']['olsrd']['config'] as $olsrd) { - if (isset($olsrd['enable']) && $olsrd['enable'] == "on") { - $is_olsr_enabled = true; - break; - } - } - } - $syscfg = $config['system']; if (!is_array($config['dhcpd'])) { $config['dhcpd'] = array(); @@ -672,12 +659,6 @@ EOPP; continue; } - if ($is_olsr_enabled == true) { - if ($dhcpifconf['netmask']) { - $subnetmask = gen_subnet_mask($dhcpifconf['netmask']); - } - } - $all_pools = array(); $all_pools[] = $dhcpifconf; if (is_array($dhcpifconf['pool'])) { @@ -1407,12 +1388,6 @@ EOD; // of each subnet here is always /64. $pdlen = 64; - if ($is_olsr_enabled == true) { - if ($dhcpv6ifconf['netmask']) { - $subnetmask = gen_subnet_maskv6($dhcpv6ifconf['netmask']); - } - } - $dnscfgv6 = ""; if ($dhcpv6ifconf['domain']) { diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index 5e36004c83..5751e83858 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -648,18 +648,6 @@ function system_routing_configure($interface = "") { echo "system_routing_configure() being called $mt\n"; } - $dont_add_route = false; - /* if OLSRD is enabled, allow WAN to house DHCP. */ - if (is_array($config['installedpackages']['olsrd'])) { - foreach ($config['installedpackages']['olsrd']['config'] as $olsrd) { - if (($olsrd['enabledyngw'] == "on") && ($olsrd['enable'] == "on")) { - $dont_add_route = true; - log_error(gettext("Not adding default route because OLSR dynamic gateway is enabled.")); - break; - } - } - } - $gateways_arr = return_gateways_array(false, true); foreach ($gateways_arr as $gateway) { // setup static interface routes for nonlocal gateways @@ -674,11 +662,9 @@ function system_routing_configure($interface = "") { } } - if ($dont_add_route == false) { - $gateways_status = return_gateways_status(true); - fixup_default_gateway("inet", $gateways_status, $gateways_arr); - fixup_default_gateway("inet6", $gateways_status, $gateways_arr); - } + $gateways_status = return_gateways_status(true); + fixup_default_gateway("inet", $gateways_status, $gateways_arr); + fixup_default_gateway("inet6", $gateways_status, $gateways_arr); system_staticroutes_configure($interface, false); @@ -938,7 +924,7 @@ function system_syslogd_start($sighup = false) { $syslogd_extra = ""; if (isset($syslogcfg)) { - $separatelogfacilities = array('ntp', 'ntpd', 'ntpdate', 'charon', 'ipsec_starter', 'openvpn', 'poes', 'l2tps', 'relayd', 'hostapd', 'dnsmasq', 'named', 'filterdns', 'unbound', 'dhcpd', 'dhcrelay', 'dhclient', 'dhcp6c', 'dpinger', 'radvd', 'routed', 'olsrd', 'zebra', 'ospfd', 'ospf6d', 'bgpd', 'miniupnpd', 'filterlog'); + $separatelogfacilities = array('ntp', 'ntpd', 'ntpdate', 'charon', 'ipsec_starter', 'openvpn', 'poes', 'l2tps', 'relayd', 'hostapd', 'dnsmasq', 'named', 'filterdns', 'unbound', 'dhcpd', 'dhcrelay', 'dhclient', 'dhcp6c', 'dpinger', 'radvd', 'routed', 'zebra', 'ospfd', 'ospf6d', 'bgpd', 'miniupnpd', 'filterlog'); $syslogconf = ""; if ($config['installedpackages']['package']) { foreach ($config['installedpackages']['package'] as $package) { @@ -952,7 +938,7 @@ function system_syslogd_start($sighup = false) { } } $facilitylist = implode(',', array_unique($separatelogfacilities)); - $syslogconf .= "!radvd,routed,olsrd,zebra,ospfd,ospf6d,bgpd,miniupnpd\n"; + $syslogconf .= "!radvd,routed,zebra,ospfd,ospf6d,bgpd,miniupnpd\n"; if (!isset($syslogcfg['disablelocallogging'])) { $syslogconf .= "*.* {$log_directive}{$g['varlog_path']}/routing.log\n"; } diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php index af3c3be952..8d370abebf 100644 --- a/src/usr/local/www/services_dhcp.php +++ b/src/usr/local/www/services_dhcp.php @@ -41,17 +41,6 @@ if (!$g['services_dhcp_server_enable']) { } $if = $_REQUEST['if']; - -/* if OLSRD is enabled, allow WAN to house DHCP. */ -if ($config['installedpackages']['olsrd']) { - foreach ($config['installedpackages']['olsrd']['config'] as $olsrd) { - if ($olsrd['enable']) { - $is_olsr_enabled = true; - break; - } - } -} - $iflist = get_configured_interface_with_descr(); /* set the starting interface */ @@ -941,15 +930,6 @@ $section->addInput(new Form_StaticText( $rangestr )); -if ($is_olsr_enabled) { - $section->addInput(new Form_Select( - 'netmask', - 'Subnet mask', - $pconfig['netmask'], - array_combine(range(32, 1, -1), range(32, 1, -1)) - )); -} - $group = new Form_Group('*Range'); $group->add(new Form_IpAddress( diff --git a/src/usr/local/www/services_dhcpv6.php b/src/usr/local/www/services_dhcpv6.php index 1b3a5cbb09..1c6b10d05b 100644 --- a/src/usr/local/www/services_dhcpv6.php +++ b/src/usr/local/www/services_dhcpv6.php @@ -101,17 +101,6 @@ if (!$g['services_dhcp_server_enable']) { } $if = $_REQUEST['if']; - -/* if OLSRD is enabled, allow WAN to house DHCP. */ -if ($config['installedpackages']['olsrd']) { - foreach ($config['installedpackages']['olsrd']['config'] as $olsrd) { - if ($olsrd['enable']) { - $is_olsr_enabled = true; - break; - } - } -} - $iflist = get_configured_interface_with_descr(); $iflist = array_merge($iflist, get_configured_pppoe_server_interfaces()); @@ -635,15 +624,6 @@ if (is_ipaddrv6($ifcfgip)) { ))->setHelp($trackifname ? 'Prefix Delegation subnet will be appended to the beginning of the defined range':''); } -if ($is_olsr_enabled) { - $section->addInput(new Form_Select( - 'netmask', - 'Subnet Mask', - $pconfig['netmask'], - array_combine(range(128, 1, -1), range(128, 1, -1)) - )); -} - $f1 = new Form_Input( 'range_from', null, diff --git a/src/usr/local/www/services_router_advertisements.php b/src/usr/local/www/services_router_advertisements.php index d1e9d9c3de..9d741258c4 100644 --- a/src/usr/local/www/services_router_advertisements.php +++ b/src/usr/local/www/services_router_advertisements.php @@ -40,16 +40,6 @@ if (!$g['services_dhcp_server_enable']) { $if = $_REQUEST['if']; -/* if OLSRD is enabled, allow WAN to house DHCP. */ -if ($config['installedpackages']['olsrd']) { - foreach ($config['installedpackages']['olsrd']['config'] as $olsrd) { - if ($olsrd['enable']) { - $is_olsr_enabled = true; - break; - } - } -} - if (!$_REQUEST['if']) { $info_msg = gettext("The DHCPv6 Server can only be enabled on interfaces configured with static, non unique local IP addresses.") . "
" . gettext("Only interfaces configured with a static IP will be shown.");