aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-01-24 23:23:21 +0000
committerScott Ullrich <sullrich@pfsense.org>2009-01-24 23:23:21 +0000
commit37d565713feb827d9711cbc14b920c53c68be233 (patch)
tree616a46ace9e930594fe4df5a8657920f9f2f1409 /packages
parentdc3a121cb5805063d8666b76d82808dcd846844e (diff)
downloadpfsense-packages-37d565713feb827d9711cbc14b920c53c68be233.tar.gz
pfsense-packages-37d565713feb827d9711cbc14b920c53c68be233.tar.bz2
pfsense-packages-37d565713feb827d9711cbc14b920c53c68be233.zip
* Add denyinterfaces option.
* Deny WAN by default
Diffstat (limited to 'packages')
-rw-r--r--packages/avahi/avahi.inc15
-rw-r--r--packages/avahi/avahi.xml7
2 files changed, 22 insertions, 0 deletions
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 = <<<EOF
@@ -81,6 +95,7 @@ function setup_avahi() {
host-name={$hostname}
domain-name={$domain}
browse-domains={$browsedomains}
+deny-interfaces={$denyinterfaces}
use-ipv4=yes
use-ipv6=no
enable-dbus=no
diff --git a/packages/avahi/avahi.xml b/packages/avahi/avahi.xml
index d393fc50..4d27a9db 100644
--- a/packages/avahi/avahi.xml
+++ b/packages/avahi/avahi.xml
@@ -68,6 +68,13 @@
<description>Enter the domains that you would like proxied. (example: local, pfsense.org, mydomain.com)</description>
<type>input</type>
</field>
+ <field>
+ <fielddescr>Deny interfaces</fielddescr>
+ <fieldname>denyinterfaces</fieldname>
+ <description>Interfaces that you do NOT want Avahi to listen on. NOTE: WAN is disabled by default.</description>
+ <type>interfaces_selection</type>
+ <multiple>true</multiple>
+ </field>
</fields>
<custom_add_php_command>
setup_avahi();