Backport of 39283c8edbc5991b589d48a8e17152042193f2df from master
Regression in df41b5a05d4e00e80e73afe629072e37873e767a.
Thanks Aymeric Augustin for shepherding the DEP and patch review. Thanks Marten Kenbeek and Tim Graham for contributing to the code. Thanks Tom Christie, Shai Berger, and Tim Graham for the docs.