summaryrefslogtreecommitdiff
path: root/vpn
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-02-19 10:45:04 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-02-19 14:29:38 +0200
commitce3ebabc5b922c883e17b775211dfdfc3430d527 (patch)
tree8e8b30e31c7f3c941f342eb23e76e52e12d52964 /vpn
parentac1e346c6e1f2d37c228a46021d1c2e107d72f6b (diff)
downloadconnman-ce3ebabc5b922c883e17b775211dfdfc3430d527.tar.gz
connman-ce3ebabc5b922c883e17b775211dfdfc3430d527.tar.bz2
connman-ce3ebabc5b922c883e17b775211dfdfc3430d527.zip
vpn-provider: Do not send state property if state is not changed
Diffstat (limited to 'vpn')
-rw-r--r--vpn/vpn-provider.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c
index 3cd7c6d6..6a77c1e6 100644
--- a/vpn/vpn-provider.c
+++ b/vpn/vpn-provider.c
@@ -1191,12 +1191,14 @@ static int provider_indicate_state(struct vpn_provider *provider,
enum vpn_provider_state state)
{
const char *str;
+ enum vpn_provider_state old_state;
str = state2string(state);
DBG("provider %p state %s/%d", provider, str, state);
if (str == NULL)
return -EINVAL;
+ old_state = provider->state;
provider->state = state;
if (state == VPN_PROVIDER_STATE_READY) {
@@ -1214,9 +1216,11 @@ static int provider_indicate_state(struct vpn_provider *provider,
append_ipv6, provider);
}
- connman_dbus_property_changed_basic(provider->path,
+ if (old_state != state)
+ connman_dbus_property_changed_basic(provider->path,
VPN_CONNECTION_INTERFACE, "State",
DBUS_TYPE_STRING, &str);
+
/*
* We do not stay in failure state as clients like connmand can
* get confused about our current state.