Project

General

Profile

« Previous | Next » 

Revision 89a746a9

Added by Jim Pingle over 6 years ago

Remove obsolete OLSRD code. Implements #9117

(cherry picked from commit 592bec817f152a7536572a675079776138827cc8)

View differences:

src/etc/inc/services.inc
479 479
		return 0;
480 480
	}
481 481

  
482
	/* if OLSRD is enabled, allow WAN to house DHCP. */
483
	if (!function_exists('is_package_installed')) {
484
		require_once('pkg-utils.inc');
485
	}
486
	if (is_package_installed('olsrd') && isset($config['installedpackages']['olsrd'])) {
487
		foreach ($config['installedpackages']['olsrd']['config'] as $olsrd) {
488
			if (isset($olsrd['enable']) && $olsrd['enable'] == "on") {
489
				$is_olsr_enabled = true;
490
				break;
491
			}
492
		}
493
	}
494

  
495 482
	$syscfg = $config['system'];
496 483
	if (!is_array($config['dhcpd'])) {
497 484
		$config['dhcpd'] = array();
......
672 659
			continue;
673 660
		}
674 661

  
675
		if ($is_olsr_enabled == true) {
676
			if ($dhcpifconf['netmask']) {
677
				$subnetmask = gen_subnet_mask($dhcpifconf['netmask']);
678
			}
679
		}
680

  
681 662
		$all_pools = array();
682 663
		$all_pools[] = $dhcpifconf;
683 664
		if (is_array($dhcpifconf['pool'])) {
......
1407 1388
		// of each subnet here is always /64.
1408 1389
		$pdlen = 64;
1409 1390

  
1410
		if ($is_olsr_enabled == true) {
1411
			if ($dhcpv6ifconf['netmask']) {
1412
				$subnetmask = gen_subnet_maskv6($dhcpv6ifconf['netmask']);
1413
			}
1414
		}
1415

  
1416 1391
		$dnscfgv6 = "";
1417 1392

  
1418 1393
		if ($dhcpv6ifconf['domain']) {
src/etc/inc/system.inc
648 648
		echo "system_routing_configure() being called $mt\n";
649 649
	}
650 650

  
651
	$dont_add_route = false;
652
	/* if OLSRD is enabled, allow WAN to house DHCP. */
653
	if (is_array($config['installedpackages']['olsrd'])) {
654
		foreach ($config['installedpackages']['olsrd']['config'] as $olsrd) {
655
			if (($olsrd['enabledyngw'] == "on") && ($olsrd['enable'] == "on")) {
656
				$dont_add_route = true;
657
				log_error(gettext("Not adding default route because OLSR dynamic gateway is enabled."));
658
				break;
659
			}
660
		}
661
	}
662

  
663 651
	$gateways_arr = return_gateways_array(false, true);
664 652
	foreach ($gateways_arr as $gateway) {
665 653
		// setup static interface routes for nonlocal gateways
......
674 662
		}
675 663
	}
676 664

  
677
	if ($dont_add_route == false) {
678
		$gateways_status = return_gateways_status(true);
679
		fixup_default_gateway("inet", $gateways_status, $gateways_arr);
680
		fixup_default_gateway("inet6", $gateways_status, $gateways_arr);
681
	}
665
	$gateways_status = return_gateways_status(true);
666
	fixup_default_gateway("inet", $gateways_status, $gateways_arr);
667
	fixup_default_gateway("inet6", $gateways_status, $gateways_arr);
682 668

  
683 669
	system_staticroutes_configure($interface, false);
684 670

  
......
938 924

  
939 925
	$syslogd_extra = "";
940 926
	if (isset($syslogcfg)) {
941
		$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');
927
		$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');
942 928
		$syslogconf = "";
943 929
		if ($config['installedpackages']['package']) {
944 930
			foreach ($config['installedpackages']['package'] as $package) {
......
952 938
			}
953 939
		}
954 940
		$facilitylist = implode(',', array_unique($separatelogfacilities));
955
		$syslogconf .= "!radvd,routed,olsrd,zebra,ospfd,ospf6d,bgpd,miniupnpd\n";
941
		$syslogconf .= "!radvd,routed,zebra,ospfd,ospf6d,bgpd,miniupnpd\n";
956 942
		if (!isset($syslogcfg['disablelocallogging'])) {
957 943
			$syslogconf .= "*.*								{$log_directive}{$g['varlog_path']}/routing.log\n";
958 944
		}
src/usr/local/www/services_dhcp.php
41 41
}
42 42

  
43 43
$if = $_REQUEST['if'];
44

  
45
/* if OLSRD is enabled, allow WAN to house DHCP. */
46
if ($config['installedpackages']['olsrd']) {
47
	foreach ($config['installedpackages']['olsrd']['config'] as $olsrd) {
48
		if ($olsrd['enable']) {
49
			$is_olsr_enabled = true;
50
			break;
51
		}
52
	}
53
}
54

  
55 44
$iflist = get_configured_interface_with_descr();
56 45

  
57 46
/* set the starting interface */
......
941 930
	$rangestr
942 931
));
943 932

  
944
if ($is_olsr_enabled) {
945
	$section->addInput(new Form_Select(
946
		'netmask',
947
		'Subnet mask',
948
		$pconfig['netmask'],
949
		array_combine(range(32, 1, -1), range(32, 1, -1))
950
	));
951
}
952

  
953 933
$group = new Form_Group('*Range');
954 934

  
955 935
$group->add(new Form_IpAddress(
src/usr/local/www/services_dhcpv6.php
101 101
}
102 102

  
103 103
$if = $_REQUEST['if'];
104

  
105
/* if OLSRD is enabled, allow WAN to house DHCP. */
106
if ($config['installedpackages']['olsrd']) {
107
	foreach ($config['installedpackages']['olsrd']['config'] as $olsrd) {
108
		if ($olsrd['enable']) {
109
			$is_olsr_enabled = true;
110
			break;
111
		}
112
	}
113
}
114

  
115 104
$iflist = get_configured_interface_with_descr();
116 105
$iflist = array_merge($iflist, get_configured_pppoe_server_interfaces());
117 106

  
......
635 624
		))->setHelp($trackifname ? 'Prefix Delegation subnet will be appended to the beginning of the defined range':'');
636 625
}
637 626

  
638
if ($is_olsr_enabled) {
639
	$section->addInput(new Form_Select(
640
	'netmask',
641
	'Subnet Mask',
642
	$pconfig['netmask'],
643
	array_combine(range(128, 1, -1), range(128, 1, -1))
644
	));
645
}
646

  
647 627
$f1 = new Form_Input(
648 628
	'range_from',
649 629
	null,
src/usr/local/www/services_router_advertisements.php
40 40

  
41 41
$if = $_REQUEST['if'];
42 42

  
43
/* if OLSRD is enabled, allow WAN to house DHCP. */
44
if ($config['installedpackages']['olsrd']) {
45
	foreach ($config['installedpackages']['olsrd']['config'] as $olsrd) {
46
		if ($olsrd['enable']) {
47
			$is_olsr_enabled = true;
48
			break;
49
		}
50
	}
51
}
52

  
53 43
if (!$_REQUEST['if']) {
54 44
	$info_msg = gettext("The DHCPv6 Server can only be enabled on interfaces configured with static, non unique local IP addresses.") . "<br />" .
55 45
	    gettext("Only interfaces configured with a static IP will be shown.");

Also available in: Unified diff