提交 c0fa7713 编写于 作者: D Daniel P. Berrangé

conf: report an error if nic needs filtering by no driver is present

If a <interface> includes a filter name but the nwfilter driver is not
present we silently do nothing. This is very bad, because an application
that thinks it is protected by malicious guest traffic will in fact be
vulnerable. Reporting an error gives the administrator the ability to
know there is a problem and fix it.
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 fca9afa0
......@@ -28,6 +28,9 @@
#include "datatypes.h"
#include "domain_conf.h"
#include "domain_nwfilter.h"
#include "virerror.h"
#define VIR_FROM_THIS VIR_FROM_NWFILTER
static virDomainConfNWFilterDriverPtr nwfilterDriver;
......@@ -44,8 +47,10 @@ virDomainConfNWFilterInstantiate(const char *vmname,
{
if (nwfilterDriver != NULL)
return nwfilterDriver->instantiateFilter(vmname, vmuuid, net);
/* driver module not available -- don't indicate failure */
return 0;
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("No network filter driver available"));
return -1;
}
void
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册