提交 d4897acf 编写于 作者: S Stefan Berger

nwfilter: also purge ip(6)tables rules before detecting IP address

Rather than only cleaning any remaining ebtables rules, also clean those applied to iptables and ip6tables when detecting the IP address of an interface. Previous applied iptables rules may hinder DHCP packets.
上级 7b7cb1ec
...@@ -117,6 +117,7 @@ static int ebtablesRemoveBasicRules(const char *ifname); ...@@ -117,6 +117,7 @@ static int ebtablesRemoveBasicRules(const char *ifname);
static int ebiptablesDriverInit(void); static int ebiptablesDriverInit(void);
static void ebiptablesDriverShutdown(void); static void ebiptablesDriverShutdown(void);
static int ebtablesCleanAll(const char *ifname); static int ebtablesCleanAll(const char *ifname);
static int ebiptablesAllTeardown(const char *ifname);
static virMutex execCLIMutex; static virMutex execCLIMutex;
...@@ -2942,7 +2943,7 @@ ebtablesApplyBasicRules(const char *ifname, ...@@ -2942,7 +2943,7 @@ ebtablesApplyBasicRules(const char *ifname,
virFormatMacAddr(macaddr, macaddr_str); virFormatMacAddr(macaddr, macaddr_str);
ebtablesCleanAll(ifname); ebiptablesAllTeardown(ifname);
ebtablesCreateTmpRootChain(&buf, 1, ifname, 1); ebtablesCreateTmpRootChain(&buf, 1, ifname, 1);
...@@ -3041,7 +3042,7 @@ ebtablesApplyDHCPOnlyRules(const char *ifname, ...@@ -3041,7 +3042,7 @@ ebtablesApplyDHCPOnlyRules(const char *ifname,
virFormatMacAddr(macaddr, macaddr_str); virFormatMacAddr(macaddr, macaddr_str);
ebtablesCleanAll(ifname); ebiptablesAllTeardown(ifname);
ebtablesCreateTmpRootChain(&buf, 1, ifname, 1); ebtablesCreateTmpRootChain(&buf, 1, ifname, 1);
ebtablesCreateTmpRootChain(&buf, 0, ifname, 1); ebtablesCreateTmpRootChain(&buf, 0, ifname, 1);
...@@ -3143,7 +3144,7 @@ ebtablesApplyDropAllRules(const char *ifname) ...@@ -3143,7 +3144,7 @@ ebtablesApplyDropAllRules(const char *ifname)
return 1; return 1;
} }
ebtablesCleanAll(ifname); ebiptablesAllTeardown(ifname);
ebtablesCreateTmpRootChain(&buf, 1, ifname, 1); ebtablesCreateTmpRootChain(&buf, 1, ifname, 1);
ebtablesCreateTmpRootChain(&buf, 0, ifname, 1); ebtablesCreateTmpRootChain(&buf, 0, ifname, 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册