From 390ba161f0288bb128f911f52a87ffc334066119 Mon Sep 17 00:00:00 2001 From: kishan Date: Tue, 27 Sep 2011 18:12:30 +0530 Subject: [PATCH] bug 11547: VMware - Reset iptables counter when a public interface on domR is removed status 11547: resolved fixed reviewed-by: Ram --- patches/systemvm/debian/config/root/clearUsageRules.sh | 4 ++-- patches/systemvm/debian/config/root/netusage.sh | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/patches/systemvm/debian/config/root/clearUsageRules.sh b/patches/systemvm/debian/config/root/clearUsageRules.sh index 3a6edca7c77..671dc4c051a 100755 --- a/patches/systemvm/debian/config/root/clearUsageRules.sh +++ b/patches/systemvm/debian/config/root/clearUsageRules.sh @@ -37,8 +37,8 @@ then # remove rules iptables -D NETWORK_STATS -i eth0 -o $i > /dev/null; iptables -D NETWORK_STATS -i $i -o eth0 > /dev/null; - iptables -D NETWORK_STATS -o $pubIf ! -i eth0 -p tcp > /dev/null; - iptables -D NETWORK_STATS -i $pubIf ! -o eth0 -p tcp > /dev/null; + iptables -D NETWORK_STATS -o $i ! -i eth0 -p tcp > /dev/null; + iptables -D NETWORK_STATS -i $i ! -o eth0 -p tcp > /dev/null; fi done rm /root/removedVifs diff --git a/patches/systemvm/debian/config/root/netusage.sh b/patches/systemvm/debian/config/root/netusage.sh index af7f8fbc281..f7dbd4a4ab3 100644 --- a/patches/systemvm/debian/config/root/netusage.sh +++ b/patches/systemvm/debian/config/root/netusage.sh @@ -64,7 +64,9 @@ delete_public_interface () { } get_usage () { - iptables -L NETWORK_STATS -n -v -x | awk '$1 ~ /^[0-9]+$/ { printf "%s:", $2}'; /root/clearUsageRules.sh > /dev/null + iptables -L NETWORK_STATS -n -v -x | awk '$1 ~ /^[0-9]+$/ { printf "%s:", $2}'; > /dev/null + if [ -f /root/removedVifs ] ; then iptables -Z NETWORK_STATS ; fi; > /dev/null + /root/clearUsageRules.sh > /dev/null if [ $? -gt 0 -a $? -ne 2 ] then printf $?