KVM security bug: no forwarding rule applied

(cherry picked from commit e5c391fcf3852e50ebd99d4a72fd51d1753b05eb)

Signed-off-by: Animesh Chaturvedi <animesh@apache.org>
This commit is contained in:
Edison Su 2014-03-14 14:40:48 -07:00 committed by Anthony Xu
parent e656201fee
commit 2276a399ac

View File

@ -978,7 +978,7 @@ def addFWFramework(brname):
execute("iptables -N " + brfwin)
try:
refs = execute("""iptables -n -L " + brfw + " | awk '/%s(.*)references/ {gsub(/\(/, "") ;print $3}'""" % brfw).strip()
refs = execute("""iptables -n -L %s | awk '/%s(.*)references/ {gsub(/\(/, "") ;print $3}'""" % (brfw,brfw)).strip()
if refs == "0":
execute("iptables -I FORWARD -i " + brname + " -j DROP")
execute("iptables -I FORWARD -o " + brname + " -j DROP")