summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal Luci <eri@pfsense.org>2009-01-28 18:13:50 +0000
committerErmal Luci <eri@pfsense.org>2009-01-28 18:13:50 +0000
commit41997fbbeb2b5c50507ad18fa4ea2bb6fbea4ee2 (patch)
tree19bbf8897e0a0c11faf7f9d5c20f912b233c750b /etc
parentf668d1597294dd35244cd4dc0d76626b58336b2d (diff)
downloadpfsense-41997fbbeb2b5c50507ad18fa4ea2bb6fbea4ee2.zip
pfsense-41997fbbeb2b5c50507ad18fa4ea2bb6fbea4ee2.tar.gz
Add the GUI part for IGMPproxy that has been on the snapshots for a while.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/services.inc55
-rwxr-xr-xetc/rc.bootup5
2 files changed, 59 insertions, 1 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index ea7e82f..bd1e75b 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -329,6 +329,61 @@ EOD;
return 0;
}
+function services_igmpproxy_configure() {
+ global $config, $g;
+
+ $iflist = get_configured_interface_list();
+
+ /* kill any running igmpproxy */
+ killbyname("igmpproxy");
+
+ if (!is_array($config['igmpproxy']['igmpentry']))
+ return 1;
+
+ $igmpconf = <<<EOD
+
+##------------------------------------------------------
+## Enable Quickleave mode (Sends Leave instantly)
+##------------------------------------------------------
+quickleave
+
+EOD;
+
+ foreach ($config['igmpproxy']['igmpentry'] as $igmpcf) {
+ unset($iflist[$igmpcf['ifname']]);
+ $realif = get_real_interface($igmpcf['ifname']);
+ if (empty($igmpcf['threshold']))
+ $threshld = 1;
+ else
+ $threshld = $igmpcf['threshold'];
+ $igmpconf .= "phyint {$realif} {$igmpcf['type']} ratelimit 0 threshold {$threshld}\n";
+
+ if ($igmpcf['address'] <> "") {
+ $item = explode(" ", $igmpcf['address']);
+ foreach($item as $iww)
+ $igmpconf .= "altnet {$iww}\n";
+ }
+ $igmpconf .= "\n";
+ }
+ foreach ($iflist as $ifn) {
+ $realif = get_real_interface($ifn);
+ $igmpconf .= "phyint {$realif} disabled\n";
+ }
+
+ $igmpfl = fopen($g['tmp_path'] . "/igmpproxy.conf", "w");
+ if (!$igmpfl) {
+ log_error("Could not write Igmpproxy configuration file!");
+ return;
+ }
+ fwrite($igmpfl, $igmpconf);
+ fclose($igmpfl);
+
+ mwexec("/usr/local/sbin/igmpproxy -c " . $g['tmp_path'] . "/igmpproxy.conf");
+ log_error("Started Igmpproxy service sucsesfully.");
+
+ return 0;
+}
+
function interfaces_staticarp_configure($if) {
global $config, $g;
if(isset($config['system']['developerspew'])) {
diff --git a/etc/rc.bootup b/etc/rc.bootup
index 6229910..53bcf1f 100755
--- a/etc/rc.bootup
+++ b/etc/rc.bootup
@@ -279,6 +279,9 @@
if($kern_hz == "1000")
mwexec("sysctl net.inet.tcp.rexmit_min=30");
+ /* start the igmpproxy daemon
+ services_igmpproxy_configure();
+
/* start the upnp daemon if it is enabled */
upnp_start();
@@ -288,4 +291,4 @@
unlink("{$g['varrun_path']}/booting");
$g['booting'] = FALSE;
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud