]> xenbits.xensource.com Git - 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)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 31 May 2013 14:43:29 +0000 (10:43 -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.

src/nwfilter/nwfilter_learnipaddr.c

index 2b493337f98a24b366d980c1f6743d4d96aa137d..eabcf94e5cadc4b0195f90a8cdef860ea3406794 100644 (file)
@@ -251,6 +251,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;