Hi, While debugging weird pptp vpn issues (thanks lufie!), I noticed some races and bugs in the current vpn code.
In patch 1 we clear the data pointer (which points to ourselves) so that we do not accidentally try to access freed memory later. The inotify generated two events (create + modify) for a .config file that is copied configuration directory. This caused weird issues with old code, mainly we first created config, then when modify event was received, we removed the justly created config and re-created it again. All this without any good reason. So the fix in patch 2 is just to ignore the create event and create the config in the modify event. Patches 3 and 4 rename provider remove function so that it can be called from vpn plugin. When a vpn connection is removed, vpnd will send remove signal which should cause provider removal. Old code just unreffed the provider which left the it hanging in the service list. This is fixed in patch 5. Patches 7 and 8 try to make sure that if we get a removal signal from vpnd for already removed vpn connection, we do not try to accidentally access it. Cheers, Jukka Jukka Rissanen (8): vpn: Clear the data pointer from provider when destroying vpn-config: Ignore IN_CREATE as IN_MODIFY is called anyway provider: Change the name of provider remove function provider: New provider removal function callable from vpn plugin vpn: Remove VPN provider from service list when destroying it vpn: Add debug information when vpn state changes vpn: Check whether we have already removed the provider vpn: Make sure vpn connection really exists before removing it include/provider.h | 1 + plugins/vpn.c | 21 +++++++++++++++++++-- src/connman.h | 2 +- src/manager.c | 2 +- src/provider.c | 15 ++++++++++++++- vpn/vpn-config.c | 28 ++++++++++++++++++++-------- 6 files changed, 56 insertions(+), 13 deletions(-) -- 1.7.11.4 _______________________________________________ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman