]> git.ipfire.org Git - thirdparty/libvirt.git/commit
nwfilter: Fix learning address thread shutdown
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Fri, 12 Oct 2018 07:23:07 +0000 (10:23 +0300)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 17 Oct 2018 21:06:04 +0000 (17:06 -0400)
commit49825dcf31e858e88525db3f31d73a4780c9a64b
tree2a34c132315115a5ad014a0312d8d2140ac0494f
parentb05eeacbfd11b9e7faf1451d7dc90ceda68f6d32
nwfilter: Fix learning address thread shutdown

If the learning thread is configured to learn on all ethernet frames
(which is hardcoded) then chances are high that there is a packet on
every iteration of inspecting frames loop. As result we will hang on
shutdown because we don't check threadsTerminate if there is packet.

Let's just check termination conditions on every iteration. Since
we'll check each iteration, the check after pcap_next essentially
is unnecessary since on failure we'd loop back to the top and timeout
and then fail.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/nwfilter/nwfilter_learnipaddr.c