]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Check for existence of interface prior to setting terminate flag
authorJohn Ferlan <jferlan@redhat.com>
Fri, 31 May 2013 11:26:30 +0000 (07:26 -0400)
committerCole Robinson <crobinso@redhat.com>
Thu, 11 Jul 2013 21:45:32 +0000 (17:45 -0400)
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.

(cherry picked from commit 64919d978e4cc910a4475f77c0f04b866051935d)

src/nwfilter/nwfilter_learnipaddr.c

index b399092ef043e0d0a1c09ca455b1c75edee6d791..990374d535a291b302976cfb872c4cb34f30eafd 100644 (file)
@@ -250,6 +250,14 @@ virNWFilterTerminateLearnReq(const char *ifname) {
     int ifindex;
     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) {
         virResetLastError();
         return rc;