Patch by Daniel Ramöller (racoon) Fixes: #11382 (cherry picked from commit cb84f752f21bb4cf4bd9ed6999df0353aba2b57e)