There are a few too many edge-cases here to make this a scripted diff.
The following commits will move a few functions into PeerLogicValidation, where
the local connman instance can be used. This change prepares for that usage.
This is a backport from commit 28f11e9406b185dc87144f1f29af0d93eb115b4e from Core.