From a33b3576dc83169305957ff4c20ebb05bfa33a07 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 5 Jan 2010 07:13:34 -0800 Subject: [PATCH] Check interval parameters and request first update --- src/counter.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/counter.c b/src/counter.c index 31d463e..7c213b6 100644 --- a/src/counter.c +++ b/src/counter.c @@ -86,6 +86,9 @@ int __connman_counter_register(const char *owner, const char *path, DBG("owner %s path %s interval %u", owner, path, interval); + if (interval < 1) + return -EINVAL; + counter = g_hash_table_lookup(counter_table, path); if (counter != NULL) return -EEXIST; @@ -106,6 +109,8 @@ int __connman_counter_register(const char *owner, const char *path, counter->watch = g_dbus_add_disconnect_watch(connection, owner, owner_disconnect, counter, NULL); + __connman_rtnl_request_update(); + return 0; } -- 2.7.4