From 37d565713feb827d9711cbc14b920c53c68be233 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 24 Jan 2009 23:23:21 +0000 Subject: * Add denyinterfaces option. * Deny WAN by default --- packages/avahi/avahi.inc | 15 +++++++++++++++ packages/avahi/avahi.xml | 7 +++++++ 2 files changed, 22 insertions(+) (limited to 'packages/avahi') diff --git a/packages/avahi/avahi.inc b/packages/avahi/avahi.inc index 364ded51..ccbc2589 100644 --- a/packages/avahi/avahi.inc +++ b/packages/avahi/avahi.inc @@ -55,6 +55,7 @@ function setup_avahi() { $domain = $config['system']['domain']; $enable = $config['installedpackages']['avahi']['config'][0]['enable']; $browsedomains = $config['installedpackages']['avahi']['config'][0]['browsedomains']; + $denyif = $config['installedpackages']['avahi']['config'][0]['denyinterfaces']; // Is package disabled? if(!$enable) { @@ -70,6 +71,19 @@ function setup_avahi() { if(!$browsedomains) $browsedomains = "local, 0pointer.de, zeroconf.org"; + // Never pass along WAN. Bad. + $denyinterfaces = $config['interfaces']['wan']['if']; + + // Process interfaces defined by user to deny. + if($denyif) { + $if = split(",", $denyif); + foreach($if as $i) { + $ifreal = convert_friendly_interface_to_real_interface_name($i); + if($ifreal) + $denyinterfaces .= ", " . $ifreal; + } + } + // Construct the avahi configuration $avahiconfig = <<Enter the domains that you would like proxied. (example: local, pfsense.org, mydomain.com) input + + Deny interfaces + denyinterfaces + Interfaces that you do NOT want Avahi to listen on. NOTE: WAN is disabled by default. + interfaces_selection + true + setup_avahi(); -- cgit v1.2.3