summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2008-12-01 17:16:59 -0800
committerslioch <slioch@eng-140.vyatta.com>2008-12-01 17:16:59 -0800
commit43be74e8740be9ea7d85ac76210884db53bac172 (patch)
tree4b45c3b777b59cb9291f8a6e8cc012ddbff01e39 /scripts
parentbbf232732b7335efe1a40a772f2301efcff6893c (diff)
downloadvyatta-wanloadbalance-43be74e8740be9ea7d85ac76210884db53bac172.tar.gz
vyatta-wanloadbalance-43be74e8740be9ea7d85ac76210884db53bac172.zip
fix for 3191--now use conntrack binary to return relevant entries that
are routed and marked by wlb.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/vyatta-wlb-connection.pl16
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/vyatta-wlb-connection.pl b/scripts/vyatta-wlb-connection.pl
index 308010e..902e0aa 100644
--- a/scripts/vyatta-wlb-connection.pl
+++ b/scripts/vyatta-wlb-connection.pl
@@ -25,11 +25,21 @@
use lib "/opt/vyatta/share/perl5/";
-
-if (!open($FILE, "<", "/proc/net/ip_conntrack")) {
+#examine /var/load-balance/wlb.conf for disable-source-nat
+if (!open($CONFFILE, "<", "/var/load-balance/wlb.conf")) {
return;
}
-
+$_ = <$CONFFILE>;
+if (/disable-source-nat/) {
+ if (!open($FILE, "<", "/proc/net/ip_conntrack")) {
+ return;
+ }
+}
+else {
+ if (!open($FILE, "/usr/sbin/conntrack -L -n|")) {
+ return;
+ }
+}
print "Type\tState\t\tSrc\t\t\tDst\t\t\tPackets\tBytes\n";