mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
iptables: don't log command probe failures
Commit b9dd878f
caused a regression in iptables interaction by
logging non-zero status at a higher level than VIR_INFO. Revert
that portion of the commit, as well as adding a comment explaining
why we check the status ourselves.
Reported by Nehal J Wani.
* src/util/viriptables.c (virIpTablesOnceInit): Undo log regression.
Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
f68246ac94
commit
e686ce8aa2
@ -60,6 +60,7 @@ static int
|
||||
virIpTablesOnceInit(void)
|
||||
{
|
||||
virCommandPtr cmd;
|
||||
int status;
|
||||
|
||||
#if HAVE_FIREWALLD
|
||||
firewall_cmd_path = virFindFileInPath("firewall-cmd");
|
||||
@ -70,7 +71,8 @@ virIpTablesOnceInit(void)
|
||||
cmd = virCommandNew(firewall_cmd_path);
|
||||
|
||||
virCommandAddArgList(cmd, "--state", NULL);
|
||||
if (virCommandRun(cmd, NULL) < 0) {
|
||||
/* don't log non-zero status */
|
||||
if (virCommandRun(cmd, &status) < 0 || status != 0) {
|
||||
VIR_INFO("firewall-cmd found but disabled for iptables");
|
||||
VIR_FREE(firewall_cmd_path);
|
||||
firewall_cmd_path = NULL;
|
||||
@ -87,7 +89,8 @@ virIpTablesOnceInit(void)
|
||||
|
||||
cmd = virCommandNew(IPTABLES_PATH);
|
||||
virCommandAddArgList(cmd, "-w", "-L", "-n", NULL);
|
||||
if (virCommandRun(cmd, NULL) < 0) {
|
||||
/* don't log non-zero status */
|
||||
if (virCommandRun(cmd, &status) < 0 || status != 0) {
|
||||
VIR_INFO("xtables locking not supported by your iptables");
|
||||
} else {
|
||||
VIR_INFO("using xtables locking for iptables");
|
||||
|
Loading…
Reference in New Issue
Block a user