vpn-connection: don't dispose the proxy before we get the disconnect response
authorLubomir Rintel <lkundrak@v3.sk>
Fri, 18 Mar 2016 14:30:57 +0000 (15:30 +0100)
committerLubomir Rintel <lkundrak@v3.sk>
Fri, 18 Mar 2016 17:04:55 +0000 (18:04 +0100)
commitd568eb0e6c22f3828705530dd6d6cc34e79ae002
tree4489d278b199c64bbd112917a06f71fc365c8f10
parent99ad9df34262a7eafac1127c2e47952b9f5c45dd
vpn-connection: don't dispose the proxy before we get the disconnect response

The return_method would be rejected by the dbus-daemon when the NM drops
its match, resulting in an ugly message in the log:

  method call time=1458301860.187048 sender=:1.267 -> destination=:1.276
    serial=5302 path=/org/freedesktop/NetworkManager/VPN/Plugin;
    interface=org.freedesktop.NetworkManager.VPN.Plugin; member=Disconnect
  method call time=1458301860.187054 sender=:1.267 -> destination=org.freedesktop.DBus
    serial=5303 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus;
    member=RemoveMatch
     string "type='signal',sender='org.freedesktop.DBus',
                                   interface='org.freedesktop.DBus',
                                   member='NameOwnerChanged',
                                   path='/org/freedesktop/DBus',
                                   arg0='org.freedesktop.NetworkManager.libreswan.Connection_10'"
  method return time=1458301860.187061 sender=org.freedesktop.DBus -> destination=:1.267
    serial=1835 reply_serial=5303
  ...
  method return time=1458301860.195351 sender=:1.276 -> destination=:1.267
    serial=19 reply_serial=5302
  error time=1458301860.195361 sender=org.freedesktop.DBus -> destination=:1.276
    error_name=org.freedesktop.DBus.Error.AccessDenied reply_serial=19
     string "Rejected send message, 7 matched rules; type="method_return",
             sender=":1.276" (uid=0 pid=26915
             comm="/usr/libexec/nm-libreswan-service --bus-name org.f")
             interface="(unset)" member="(unset)" error name="(unset)"
             requested_reply="0" destination=":1.267" (uid=0 pid=25724
             comm="/usr/sbin/NetworkManager --no-daemon ")"

Also, refcount the connection instance. While the proxy is alive, it
invokes singal callbacks that get the object as a parameter.
src/vpn-manager/nm-vpn-connection.c