diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2010-12-21 01:41:22 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-12-21 01:41:22 +0100 |
commit | 7aff98665b599ca6863818e97ad3b29574704964 (patch) | |
tree | 707d8d2d7dd72bdfffec70f86ef8aed2f0be4f04 | |
parent | a0f2e331c88baa143a9c2a48e4ddb68eea54e10a (diff) | |
download | connman-7aff98665b599ca6863818e97ad3b29574704964.tar.gz connman-7aff98665b599ca6863818e97ad3b29574704964.tar.bz2 connman-7aff98665b599ca6863818e97ad3b29574704964.zip |
openvpn: Identation fixes
-rw-r--r-- | plugins/openvpn.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/plugins/openvpn.c b/plugins/openvpn.c index f4544fec..4d137767 100644 --- a/plugins/openvpn.c +++ b/plugins/openvpn.c @@ -71,36 +71,35 @@ static void ov_provider_append_routes(gpointer key, gpointer value, static struct ov_route *ov_route_lookup(const char *key, const char *prefix_key, GHashTable *routes) { - if (g_str_has_prefix(key, prefix_key)) { - unsigned long idx; - const char *start; - char *end; - struct ov_route *route; + unsigned long idx; + const char *start; + char *end; + struct ov_route *route; - start = key + strlen(prefix_key); - idx = g_ascii_strtoull(start, &end, 10); + if (g_str_has_prefix(key, prefix_key) == FALSE) + return NULL; - if (idx == 0 && start == end) { - connman_error("string conversion failed %s", start); - return NULL; - } + start = key + strlen(prefix_key); + idx = g_ascii_strtoull(start, &end, 10); - route = g_hash_table_lookup(routes, GINT_TO_POINTER(idx)); - if (route == NULL) { - route = g_try_new0(struct ov_route, 1); - if (route == NULL) { - connman_error("out of memory"); - return NULL; - } + if (idx == 0 && start == end) { + connman_error("string conversion failed %s", start); + return NULL; + } - g_hash_table_replace(routes, GINT_TO_POINTER(idx), - route); + route = g_hash_table_lookup(routes, GINT_TO_POINTER(idx)); + if (route == NULL) { + route = g_try_new0(struct ov_route, 1); + if (route == NULL) { + connman_error("out of memory"); + return NULL; } - return route; + g_hash_table_replace(routes, GINT_TO_POINTER(idx), + route); } - return NULL; + return route; } static void ov_append_route(const char *key, const char *value, GHashTable *routes) @@ -144,30 +143,31 @@ static void ov_append_route(const char *key, const char *value, GHashTable *rout static void ov_append_dns_entries(const char *key, const char *value, char **dns_entries) { - if (g_str_has_prefix(key, "foreign_option_")) { - gchar **options; + gchar **options; + + if (g_str_has_prefix(key, "foreign_option_") == FALSE) + return; - options = g_strsplit(value, " ", 3); - if (options[0] != NULL && - !strcmp(options[0], "dhcp-option") && + options = g_strsplit(value, " ", 3); + if (options[0] != NULL && + !strcmp(options[0], "dhcp-option") && options[1] != NULL && !strcmp(options[1], "DNS") && - options[2] != NULL) { + options[2] != NULL) { - if (*dns_entries != NULL) { - char *tmp; + if (*dns_entries != NULL) { + char *tmp; - tmp = g_strjoin(" ", *dns_entries, + tmp = g_strjoin(" ", *dns_entries, options[2], NULL); - g_free(*dns_entries); - *dns_entries = tmp; - } else { - *dns_entries = g_strdup(options[2]); - } + g_free(*dns_entries); + *dns_entries = tmp; + } else { + *dns_entries = g_strdup(options[2]); } - - g_strfreev(options); } + + g_strfreev(options); } static int ov_notify(DBusMessage *msg, struct connman_provider *provider) |