mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
Check for existence of interface prior to setting terminate flag
https://bugzilla.redhat.com/show_bug.cgi?id=903480 During domain destruction it's possible that the learnIPAddressThread has already removed the interface prior to the teardown filter path being run. The teardown code would only be telling the thread to terminate.
This commit is contained in:
parent
2f3e7f1e36
commit
64919d978e
@ -251,6 +251,14 @@ virNWFilterTerminateLearnReq(const char *ifname) {
|
|||||||
int ifindex;
|
int ifindex;
|
||||||
virNWFilterIPAddrLearnReqPtr req;
|
virNWFilterIPAddrLearnReqPtr req;
|
||||||
|
|
||||||
|
/* It's possible that it's already been removed as a result of
|
||||||
|
* virNWFilterDeregisterLearnReq during learnIPAddressThread() exit
|
||||||
|
*/
|
||||||
|
if (virNetDevExists(ifname) != 1) {
|
||||||
|
virResetLastError();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (virNetDevGetIndex(ifname, &ifindex) < 0) {
|
if (virNetDevGetIndex(ifname, &ifindex) < 0) {
|
||||||
virResetLastError();
|
virResetLastError();
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
Reference in New Issue
Block a user