service: Sort VPNs using the transport service if connected

Use the transport to verify the order of the connected VPN services. If
there is a transport service in use that ranks lower than an another
service it means that the order must be changed based on comparing the
transport and the service instead of comparing VPN and the service. This
is because the higher ranking service should then become the transport
of the VPN.

This ensures that when the list is sorted the transport check in
plugins/vpn.c will make VPN to switch to the new transport that is
enabled to be the default. Use of the service ident from hash table for
searching is used because the index cannot be retrieved from the list
while sorting the list.
1 file changed