aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@pfSense.org>2013-09-09 12:29:44 -0700
committerRenato Botelho <garga@pfSense.org>2013-09-09 12:29:44 -0700
commit6906202e5414898843eb1867382a9587de509f9f (patch)
treec5b786c352e7283993a3ab47839124e369e1beaf
parent58d93a47ef523a42260e4e4e97289be4501eb5ea (diff)
parenta5695467b13b179b14a9c69dc3d6767ceffebabd (diff)
downloadpfsense-packages-6906202e5414898843eb1867382a9587de509f9f.tar.gz
pfsense-packages-6906202e5414898843eb1867382a9587de509f9f.tar.bz2
pfsense-packages-6906202e5414898843eb1867382a9587de509f9f.zip
Merge pull request #482 from phil-davis/master
bandwidthd - check for interface subnet also specified by user
-rw-r--r--config/bandwidthd/bandwidthd.inc19
-rw-r--r--config/bandwidthd/bandwidthd.xml2
-rw-r--r--pkg_config.8.xml2
-rw-r--r--pkg_config.8.xml.amd642
4 files changed, 17 insertions, 8 deletions
diff --git a/config/bandwidthd/bandwidthd.inc b/config/bandwidthd/bandwidthd.inc
index 00e3cd28..45709ec3 100644
--- a/config/bandwidthd/bandwidthd.inc
+++ b/config/bandwidthd/bandwidthd.inc
@@ -139,13 +139,22 @@ function bandwidthd_install_config() {
$ifcfg = $config['interfaces'][$int];
$subnet = gen_subnet($ifcfg['ipaddr'], $ifcfg['subnet']);
$subnetmask = gen_subnet_mask($ifcfg['subnet']);
+ $subnet_with_mask = "";
if($subnet == "pppoe") {
$subnet = find_interface_ip("ng0");
- if($subnet)
- $subnets .= "subnet {$subnet}/32\n";
+ if($subnet) {
+ $subnet_with_mask = $subnet . "/32";
+ }
} else {
- if($subnet)
- $subnets .= "subnet {$subnet}/{$ifcfg['subnet']}\n";
+ if($subnet) {
+ $subnet_with_mask = $subnet . "/" . $ifcfg['subnet'];
+ }
+ }
+ if (!empty($subnet_with_mask)) {
+ /* Only add the subnet if the user has not specified it in the custom subnets. */
+ /* This avoids generating an unnecessary syntax error message from the config. */
+ if (!in_array($subnet_with_mask, $subnets_custom))
+ $subnets .= "subnet {$subnet_with_mask}\n";
}
}
}
@@ -197,7 +206,7 @@ $dev
# intervals to skip before doing a graphing run
$skip_intervals
-# Graph cutoff is how many k must be transfered by an
+# Graph cutoff is how many k must be transferred by an
# ip before we bother to graph it
$graph_cutoff
diff --git a/config/bandwidthd/bandwidthd.xml b/config/bandwidthd/bandwidthd.xml
index d0753a01..71e5e8fc 100644
--- a/config/bandwidthd/bandwidthd.xml
+++ b/config/bandwidthd/bandwidthd.xml
@@ -46,7 +46,7 @@
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>bandwidthd</name>
- <version>2.0.1_5 pkg v.0.1</version>
+ <version>2.0.1_5 pkg v.0.2</version>
<title>Bandwidthd</title>
<aftersaveredirect>/pkg_edit.php?xml=bandwidthd.xml&amp;id=0</aftersaveredirect>
<include_file>/usr/local/pkg/bandwidthd.inc</include_file>
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index a3fb68d9..00cb7111 100644
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -1116,7 +1116,7 @@
<website>http://bandwidthd.sourceforge.net/</website>
<descr>BandwidthD tracks usage of TCP/IP network subnets and builds html files with graphs to display utilization. Charts are built by individual IPs, and by default display utilization over 2 day, 8 day, 40 day, and 400 day periods. Furthermore, each ip address's utilization can be logged out at intervals of 3.3 minutes, 10 minutes, 1 hour or 12 hours in cdf format, or to a backend database server. HTTP, TCP, UDP, ICMP, VPN, and P2P traffic are color coded.</descr>
<category>System</category>
- <version>2.0.1_5 pkg v.0.1</version>
+ <version>2.0.1_5 pkg v.0.2</version>
<status>BETA</status>
<required_version>1.2.1</required_version>
<depends_on_package_base_url>http://files.pfsense.org/packages/8/All/</depends_on_package_base_url>
diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64
index dd1f9b54..9c3c30e4 100644
--- a/pkg_config.8.xml.amd64
+++ b/pkg_config.8.xml.amd64
@@ -1103,7 +1103,7 @@
<website>http://bandwidthd.sourceforge.net/</website>
<descr>BandwidthD tracks usage of TCP/IP network subnets and builds html files with graphs to display utilization. Charts are built by individual IPs, and by default display utilization over 2 day, 8 day, 40 day, and 400 day periods. Furthermore, each ip address's utilization can be logged out at intervals of 3.3 minutes, 10 minutes, 1 hour or 12 hours in cdf format, or to a backend database server. HTTP, TCP, UDP, ICMP, VPN, and P2P traffic are color coded.</descr>
<category>System</category>
- <version>2.0.1_5 pkg v.0.1</version>
+ <version>2.0.1_5 pkg v.0.2</version>
<status>BETA</status>
<required_version>1.2.1</required_version>
<depends_on_package_base_url>http://files.pfsense.org/packages/amd64/8/All/</depends_on_package_base_url>