]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Prevent the cache ptr from being altered under our feet 3450/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 25 Feb 2016 14:46:22 +0000 (15:46 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 25 Feb 2016 14:46:22 +0000 (15:46 +0100)
commite6557ec896403f2e4a6e9be319ac0840dd12cc15
tree889ff8fd0a1c68228e88e233a92dae628e7c1fbd
parentf4cccfdd89014c232fa65cd56365c734b6ee0aaa
dnsdist: Prevent the cache ptr from being altered under our feet

Make sure we hold the Lua mutex before getting the packet cache
shared_ptr, so that we don't have a thread reading it at the
exact same time it is altered by another.
We could have used atomic_load/atomic_store but libstdc++ uses
a pool of mutex for that anyway.
This might fix #3396.
pdns/dnsdist-tcp.cc
pdns/dnsdist.cc