mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
Fix launch of libvirtd when DHCP snooping support is not available.
When libpcap is not available, the NWFilter driver provides a no-op stub for the DHCP snooping initialization. This was mistakenly returning '-1' instead of '0', so the entire driver initialization failed
This commit is contained in:
parent
50312d4b91
commit
b9852862ea
@ -2056,6 +2056,8 @@ virNWFilterDHCPSnoopInit(void)
|
|||||||
if (virNWFilterSnoopState.snoopReqs)
|
if (virNWFilterSnoopState.snoopReqs)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
VIR_DEBUG("Initializing DHCP snooping");
|
||||||
|
|
||||||
if (virMutexInitRecursive(&virNWFilterSnoopState.snoopLock) < 0 ||
|
if (virMutexInitRecursive(&virNWFilterSnoopState.snoopLock) < 0 ||
|
||||||
virMutexInit(&virNWFilterSnoopState.activeLock) < 0 ||
|
virMutexInit(&virNWFilterSnoopState.activeLock) < 0 ||
|
||||||
virAtomicIntInit(&virNWFilterSnoopState.nLeases) < 0 ||
|
virAtomicIntInit(&virNWFilterSnoopState.nLeases) < 0 ||
|
||||||
@ -2176,7 +2178,8 @@ virNWFilterDHCPSnoopShutdown(void)
|
|||||||
int
|
int
|
||||||
virNWFilterDHCPSnoopInit(void)
|
virNWFilterDHCPSnoopInit(void)
|
||||||
{
|
{
|
||||||
return -1;
|
VIR_DEBUG("No DHCP snooping support available");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -57,6 +57,7 @@ static virNWFilterTechDriverPtr filter_tech_drivers[] = {
|
|||||||
|
|
||||||
void virNWFilterTechDriversInit(bool privileged) {
|
void virNWFilterTechDriversInit(bool privileged) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
VIR_DEBUG("Initializing NWFilter technology drivers");
|
||||||
while (filter_tech_drivers[i]) {
|
while (filter_tech_drivers[i]) {
|
||||||
if (!(filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED))
|
if (!(filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED))
|
||||||
filter_tech_drivers[i]->init(privileged);
|
filter_tech_drivers[i]->init(privileged);
|
||||||
|
@ -782,6 +782,7 @@ virNWFilterLearnInit(void) {
|
|||||||
if (pendingLearnReq)
|
if (pendingLearnReq)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
VIR_DEBUG("Initializing IP address learning");
|
||||||
threadsTerminate = false;
|
threadsTerminate = false;
|
||||||
|
|
||||||
pendingLearnReq = virHashCreate(0, freeLearnReqEntry);
|
pendingLearnReq = virHashCreate(0, freeLearnReqEntry);
|
||||||
|
Loading…
Reference in New Issue
Block a user