From 48ab0cd21c3c8ce35f96678463ddd2f99b0b88a7 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 16 May 2006 21:36:11 +0000 Subject: Latest OLSR changes. --- etc/inc/services.inc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'etc/inc/services.inc') diff --git a/etc/inc/services.inc b/etc/inc/services.inc index b4be112..f2ee8e1 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -39,6 +39,12 @@ function services_dhcpd_configure() { echo "services_dhcpd_configure($if) being called $mt\n"; } + /* 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; + /* configure DHCPD chroot */ $fd = fopen("/tmp/dhcpd.sh","w"); $status = `mount | grep "{$g['dhcpd_chroot_path']}/dev"`; @@ -176,6 +182,10 @@ EOPP; $subnet = gen_subnet($ifcfg['ipaddr'], $ifcfg['subnet']); $subnetmask = gen_subnet_mask($ifcfg['subnet']); + if($is_olsr_enabled == true) + if($dhcpifconf['netmask']) + $subnetmask = $dhcpifconf['netmask']; + $dnscfg = ""; if ($dhcpifconf['domain']) { @@ -889,6 +899,15 @@ function setup_wireless_olsr() { if($olsr_enable <> "on") return; $fd = fopen("{$g['varetc_path']}/olsr.conf", "w"); + + if($olsrd['enableannounce'] == "on") + $enableannounce = "0.0.0.0 0.0.0.0"; + else + $enableannounce = ""; + + if($olsrd['announcedynamicroute'] == "on") + $enableannounce .= "\n{$olsrd['announcedynamicroute']}"; + $olsr .= <<