https://github.com/bitcoin/bitcoin/pull/21506/commits/7b55a9449778c5ac89799ce4c607c8c8d797ddfb
> p2p: NetPermissions::HasFlag() pass flags param by value
https://github.com/bitcoin/bitcoin/pull/21506/commits/810d0929c1626bba141af3f779a3c9cd6ece7e75
> p2p, refactor: make NetPermissionFlags a uint32 enum class
>
> and define/update operation methods to handle type conversions explicitly. See
> https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Renum-oper
> for more info.
This eliminates the class of bugs like D13323
This concludes backport of core#21506
Depends on D13324