From 43be74e8740be9ea7d85ac76210884db53bac172 Mon Sep 17 00:00:00 2001 From: slioch Date: Mon, 1 Dec 2008 17:16:59 -0800 Subject: fix for 3191--now use conntrack binary to return relevant entries that are routed and marked by wlb. --- scripts/vyatta-wlb-connection.pl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'scripts') 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"; -- cgit v1.2.3