From: John Ferlan Date: Fri, 31 May 2013 11:26:30 +0000 (-0400) Subject: Check for existence of interface prior to setting terminate flag X-Git-Tag: v1.0.5.3~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e01eedf9bfb53d7054e53b5e070e7924d3ac02c1;p=thirdparty%2Flibvirt.git 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. (cherry picked from commit 64919d978e4cc910a4475f77c0f04b866051935d) --- diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c index b399092ef0..990374d535 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -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;