5 * Copyright (C) 2007-2013 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 #include <sys/signalfd.h>
42 #define CONF_ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]) - 1)
44 #define DEFAULT_INPUT_REQUEST_TIMEOUT (120 * 1000)
45 #define DEFAULT_BROWSER_LAUNCH_TIMEOUT (300 * 1000)
47 #define MAINFILE "main.conf"
48 #define CONFIGMAINFILE CONFIGDIR "/" MAINFILE
50 static char *default_auto_connect[] = {
57 static char *default_favorite_techs[] = {
62 static char *default_blacklist[] = {
74 char **pref_timeservers;
75 unsigned int *auto_connect;
76 unsigned int *favorite_techs;
77 unsigned int *preferred_techs;
78 unsigned int *always_connected_techs;
79 char **fallback_nameservers;
80 unsigned int timeout_inputreq;
81 unsigned int timeout_browserlaunch;
82 char **blacklisted_interfaces;
83 bool allow_hostname_updates;
84 bool allow_domainname_updates;
86 char **tethering_technologies;
87 bool persistent_tethering_mode;
89 char *vendor_class_id;
90 bool enable_online_check;
91 bool auto_connect_roaming_services;
93 bool use_gateways_as_timeservers;
94 } connman_settings = {
96 .pref_timeservers = NULL,
98 .favorite_techs = NULL,
99 .preferred_techs = NULL,
100 .always_connected_techs = NULL,
101 .fallback_nameservers = NULL,
102 .timeout_inputreq = DEFAULT_INPUT_REQUEST_TIMEOUT,
103 .timeout_browserlaunch = DEFAULT_BROWSER_LAUNCH_TIMEOUT,
104 .blacklisted_interfaces = NULL,
105 .allow_hostname_updates = true,
106 .allow_domainname_updates = true,
107 .single_tech = false,
108 .tethering_technologies = NULL,
109 .persistent_tethering_mode = false,
110 .enable_6to4 = false,
111 .vendor_class_id = NULL,
112 .enable_online_check = true,
113 .auto_connect_roaming_services = false,
115 .use_gateways_as_timeservers = false,
118 #define CONF_BG_SCAN "BackgroundScanning"
119 #define CONF_PREF_TIMESERVERS "FallbackTimeservers"
120 #define CONF_AUTO_CONNECT_TECHS "DefaultAutoConnectTechnologies"
121 #define CONF_FAVORITE_TECHS "DefaultFavoriteTechnologies"
122 #define CONF_ALWAYS_CONNECTED_TECHS "AlwaysConnectedTechnologies"
123 #define CONF_PREFERRED_TECHS "PreferredTechnologies"
124 #define CONF_FALLBACK_NAMESERVERS "FallbackNameservers"
125 #define CONF_TIMEOUT_INPUTREQ "InputRequestTimeout"
126 #define CONF_TIMEOUT_BROWSERLAUNCH "BrowserLaunchTimeout"
127 #define CONF_BLACKLISTED_INTERFACES "NetworkInterfaceBlacklist"
128 #define CONF_ALLOW_HOSTNAME_UPDATES "AllowHostnameUpdates"
129 #define CONF_ALLOW_DOMAINNAME_UPDATES "AllowDomainnameUpdates"
130 #define CONF_SINGLE_TECH "SingleConnectedTechnology"
131 #define CONF_TETHERING_TECHNOLOGIES "TetheringTechnologies"
132 #define CONF_PERSISTENT_TETHERING_MODE "PersistentTetheringMode"
133 #define CONF_ENABLE_6TO4 "Enable6to4"
134 #define CONF_VENDOR_CLASS_ID "VendorClassID"
135 #define CONF_ENABLE_ONLINE_CHECK "EnableOnlineCheck"
136 #define CONF_AUTO_CONNECT_ROAMING_SERVICES "AutoConnectRoamingServices"
137 #define CONF_ACD "AddressConflictDetection"
138 #define CONF_USE_GATEWAYS_AS_TIMESERVERS "UseGatewaysAsTimeservers"
140 static const char *supported_options[] = {
142 CONF_PREF_TIMESERVERS,
143 CONF_AUTO_CONNECT_TECHS,
144 CONF_ALWAYS_CONNECTED_TECHS,
145 CONF_PREFERRED_TECHS,
146 CONF_FALLBACK_NAMESERVERS,
147 CONF_TIMEOUT_INPUTREQ,
148 CONF_TIMEOUT_BROWSERLAUNCH,
149 CONF_BLACKLISTED_INTERFACES,
150 CONF_ALLOW_HOSTNAME_UPDATES,
151 CONF_ALLOW_DOMAINNAME_UPDATES,
153 CONF_TETHERING_TECHNOLOGIES,
154 CONF_PERSISTENT_TETHERING_MODE,
156 CONF_VENDOR_CLASS_ID,
157 CONF_ENABLE_ONLINE_CHECK,
158 CONF_AUTO_CONNECT_ROAMING_SERVICES,
160 CONF_USE_GATEWAYS_AS_TIMESERVERS,
164 static GKeyFile *load_config(const char *file)
169 keyfile = g_key_file_new();
171 g_key_file_set_list_separator(keyfile, ',');
173 if (!g_key_file_load_from_file(keyfile, file, 0, &err)) {
174 if (err->code != G_FILE_ERROR_NOENT) {
175 connman_error("Parsing %s failed: %s", file,
180 g_key_file_free(keyfile);
187 static uint *parse_service_types(char **str_list, gsize len)
189 unsigned int *type_list;
191 enum connman_service_type type;
193 type_list = g_try_new0(unsigned int, len + 1);
199 while (str_list[i]) {
200 type = __connman_service_string2type(str_list[i]);
202 if (type != CONNMAN_SERVICE_TYPE_UNKNOWN) {
209 type_list[j] = CONNMAN_SERVICE_TYPE_UNKNOWN;
214 static char **parse_fallback_nameservers(char **nameservers, gsize len)
219 servers = g_try_new0(char *, len + 1);
225 while (nameservers[i]) {
226 if (connman_inet_check_ipaddress(nameservers[i]) > 0) {
227 servers[j] = g_strdup(nameservers[i]);
236 static void check_config(GKeyFile *config)
244 keys = g_key_file_get_groups(config, NULL);
246 for (j = 0; keys && keys[j]; j++) {
247 if (g_strcmp0(keys[j], "General") != 0)
248 connman_warn("Unknown group %s in %s",
254 keys = g_key_file_get_keys(config, "General", NULL, NULL);
256 for (j = 0; keys && keys[j]; j++) {
261 for (i = 0; supported_options[i]; i++) {
262 if (g_strcmp0(keys[j], supported_options[i]) == 0) {
267 if (!found && !supported_options[i])
268 connman_warn("Unknown option %s in %s",
275 static void parse_config(GKeyFile *config)
277 GError *error = NULL;
283 char *vendor_class_id;
288 connman_settings.auto_connect =
289 parse_service_types(default_auto_connect, CONF_ARRAY_SIZE(default_auto_connect));
290 connman_settings.favorite_techs =
291 parse_service_types(default_favorite_techs, CONF_ARRAY_SIZE(default_favorite_techs));
292 connman_settings.blacklisted_interfaces =
293 g_strdupv(default_blacklist);
297 DBG("parsing %s", MAINFILE);
299 boolean = g_key_file_get_boolean(config, "General",
300 CONF_BG_SCAN, &error);
302 connman_settings.bg_scan = boolean;
304 g_clear_error(&error);
306 timeservers = __connman_config_get_string_list(config, "General",
307 CONF_PREF_TIMESERVERS, NULL, &error);
309 connman_settings.pref_timeservers = timeservers;
311 g_clear_error(&error);
313 str_list = __connman_config_get_string_list(config, "General",
314 CONF_AUTO_CONNECT_TECHS, &len, &error);
317 connman_settings.auto_connect =
318 parse_service_types(str_list, len);
320 connman_settings.auto_connect =
321 parse_service_types(default_auto_connect, CONF_ARRAY_SIZE(default_auto_connect));
323 g_clear_error(&error);
325 str_list = __connman_config_get_string_list(config, "General",
326 CONF_FAVORITE_TECHS, &len, &error);
329 connman_settings.favorite_techs =
330 parse_service_types(str_list, len);
332 connman_settings.favorite_techs =
333 parse_service_types(default_favorite_techs, CONF_ARRAY_SIZE(default_favorite_techs));
335 g_strfreev(str_list);
337 g_clear_error(&error);
339 str_list = __connman_config_get_string_list(config, "General",
340 CONF_PREFERRED_TECHS, &len, &error);
343 connman_settings.preferred_techs =
344 parse_service_types(str_list, len);
346 g_strfreev(str_list);
348 g_clear_error(&error);
350 str_list = __connman_config_get_string_list(config, "General",
351 CONF_ALWAYS_CONNECTED_TECHS, &len, &error);
354 connman_settings.always_connected_techs =
355 parse_service_types(str_list, len);
357 g_strfreev(str_list);
359 g_clear_error(&error);
361 str_list = __connman_config_get_string_list(config, "General",
362 CONF_FALLBACK_NAMESERVERS, &len, &error);
365 connman_settings.fallback_nameservers =
366 parse_fallback_nameservers(str_list, len);
368 g_strfreev(str_list);
370 g_clear_error(&error);
372 timeout = g_key_file_get_integer(config, "General",
373 CONF_TIMEOUT_INPUTREQ, &error);
374 if (!error && timeout >= 0)
375 connman_settings.timeout_inputreq = timeout * 1000;
377 g_clear_error(&error);
379 timeout = g_key_file_get_integer(config, "General",
380 CONF_TIMEOUT_BROWSERLAUNCH, &error);
381 if (!error && timeout >= 0)
382 connman_settings.timeout_browserlaunch = timeout * 1000;
384 g_clear_error(&error);
386 interfaces = __connman_config_get_string_list(config, "General",
387 CONF_BLACKLISTED_INTERFACES, &len, &error);
390 connman_settings.blacklisted_interfaces = interfaces;
392 connman_settings.blacklisted_interfaces =
393 g_strdupv(default_blacklist);
395 g_clear_error(&error);
397 boolean = __connman_config_get_bool(config, "General",
398 CONF_ALLOW_HOSTNAME_UPDATES,
401 connman_settings.allow_hostname_updates = boolean;
403 g_clear_error(&error);
405 boolean = __connman_config_get_bool(config, "General",
406 CONF_ALLOW_DOMAINNAME_UPDATES,
409 connman_settings.allow_domainname_updates = boolean;
411 g_clear_error(&error);
413 boolean = __connman_config_get_bool(config, "General",
414 CONF_SINGLE_TECH, &error);
416 connman_settings.single_tech = boolean;
418 g_clear_error(&error);
420 tethering = __connman_config_get_string_list(config, "General",
421 CONF_TETHERING_TECHNOLOGIES, &len, &error);
424 connman_settings.tethering_technologies = tethering;
426 g_clear_error(&error);
428 boolean = __connman_config_get_bool(config, "General",
429 CONF_PERSISTENT_TETHERING_MODE,
432 connman_settings.persistent_tethering_mode = boolean;
434 g_clear_error(&error);
436 boolean = __connman_config_get_bool(config, "General",
437 CONF_ENABLE_6TO4, &error);
439 connman_settings.enable_6to4 = boolean;
441 g_clear_error(&error);
443 vendor_class_id = __connman_config_get_string(config, "General",
444 CONF_VENDOR_CLASS_ID, &error);
446 connman_settings.vendor_class_id = vendor_class_id;
448 g_clear_error(&error);
450 boolean = __connman_config_get_bool(config, "General",
451 CONF_ENABLE_ONLINE_CHECK, &error);
453 connman_settings.enable_online_check = boolean;
455 connman_info("Online check disabled by main config.");
458 g_clear_error(&error);
460 boolean = __connman_config_get_bool(config, "General",
461 CONF_AUTO_CONNECT_ROAMING_SERVICES, &error);
463 connman_settings.auto_connect_roaming_services = boolean;
465 g_clear_error(&error);
467 boolean = __connman_config_get_bool(config, "General", CONF_ACD, &error);
469 connman_settings.acd = boolean;
471 g_clear_error(&error);
473 boolean = __connman_config_get_bool(config, "General",
474 CONF_USE_GATEWAYS_AS_TIMESERVERS, &error);
476 connman_settings.use_gateways_as_timeservers = boolean;
478 g_clear_error(&error);
481 static int config_init(const char *file)
485 config = load_config(file);
486 check_config(config);
487 parse_config(config);
489 g_key_file_free(config);
494 static GMainLoop *main_loop = NULL;
496 static unsigned int __terminated = 0;
498 static gboolean signal_handler(GIOChannel *channel, GIOCondition cond,
501 struct signalfd_siginfo si;
505 if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP))
508 fd = g_io_channel_unix_get_fd(channel);
510 result = read(fd, &si, sizeof(si));
511 if (result != sizeof(si))
514 switch (si.ssi_signo) {
517 if (__terminated == 0) {
518 connman_info("Terminating");
519 g_main_loop_quit(main_loop);
529 static guint setup_signalfd(void)
537 sigaddset(&mask, SIGINT);
538 sigaddset(&mask, SIGTERM);
540 if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0) {
541 perror("Failed to set signal mask");
545 fd = signalfd(-1, &mask, 0);
547 perror("Failed to create signal descriptor");
551 channel = g_io_channel_unix_new(fd);
553 g_io_channel_set_close_on_unref(channel, TRUE);
554 g_io_channel_set_encoding(channel, NULL, NULL);
555 g_io_channel_set_buffered(channel, FALSE);
557 source = g_io_add_watch(channel,
558 G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
559 signal_handler, NULL);
561 g_io_channel_unref(channel);
566 static void disconnect_callback(DBusConnection *conn, void *user_data)
568 connman_error("D-Bus disconnect");
570 g_main_loop_quit(main_loop);
573 static gchar *option_config = NULL;
574 static gchar *option_debug = NULL;
575 static gchar *option_device = NULL;
576 static gchar *option_plugin = NULL;
577 static gchar *option_nodevice = NULL;
578 static gchar *option_noplugin = NULL;
579 static gchar *option_wifi = NULL;
580 static gboolean option_detach = TRUE;
581 static gboolean option_dnsproxy = TRUE;
582 static gboolean option_backtrace = TRUE;
583 static gboolean option_version = FALSE;
585 static bool parse_debug(const char *key, const char *value,
586 gpointer user_data, GError **error)
590 char *prev = option_debug;
592 option_debug = g_strconcat(prev, ",", value, NULL);
595 option_debug = g_strdup(value);
598 g_free(option_debug);
599 option_debug = g_strdup("*");
605 static bool parse_noplugin(const char *key, const char *value,
606 gpointer user_data, GError **error)
608 if (option_noplugin) {
609 char *prev = option_noplugin;
611 option_noplugin = g_strconcat(prev, ",", value, NULL);
614 option_noplugin = g_strdup(value);
620 static GOptionEntry options[] = {
621 { "config", 'c', 0, G_OPTION_ARG_STRING, &option_config,
622 "Load the specified configuration file "
623 "instead of " CONFIGMAINFILE, "FILE" },
624 { "debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG,
625 G_OPTION_ARG_CALLBACK, parse_debug,
626 "Specify debug options to enable", "DEBUG" },
627 { "device", 'i', 0, G_OPTION_ARG_STRING, &option_device,
628 "Specify networking devices or interfaces", "DEV,..." },
629 { "nodevice", 'I', 0, G_OPTION_ARG_STRING, &option_nodevice,
630 "Specify networking interfaces to ignore", "DEV,..." },
631 { "plugin", 'p', 0, G_OPTION_ARG_STRING, &option_plugin,
632 "Specify plugins to load", "NAME,..." },
633 { "noplugin", 'P', 0, G_OPTION_ARG_CALLBACK, &parse_noplugin,
634 "Specify plugins not to load", "NAME,..." },
635 { "wifi", 'W', 0, G_OPTION_ARG_STRING, &option_wifi,
636 "Specify driver for WiFi/Supplicant", "NAME" },
637 { "nodaemon", 'n', G_OPTION_FLAG_REVERSE,
638 G_OPTION_ARG_NONE, &option_detach,
639 "Don't fork daemon to background" },
640 { "nodnsproxy", 'r', G_OPTION_FLAG_REVERSE,
641 G_OPTION_ARG_NONE, &option_dnsproxy,
642 "Don't support DNS resolving" },
643 { "nobacktrace", 0, G_OPTION_FLAG_REVERSE,
644 G_OPTION_ARG_NONE, &option_backtrace,
645 "Don't print out backtrace information" },
646 { "version", 'v', 0, G_OPTION_ARG_NONE, &option_version,
647 "Show version information and exit" },
651 const char *connman_option_get_string(const char *key)
653 if (g_str_equal(key, CONF_VENDOR_CLASS_ID))
654 return connman_settings.vendor_class_id;
656 if (g_strcmp0(key, "wifi") == 0) {
658 return "nl80211,wext";
666 bool connman_setting_get_bool(const char *key)
668 if (g_str_equal(key, CONF_BG_SCAN))
669 return connman_settings.bg_scan;
671 if (g_str_equal(key, CONF_ALLOW_HOSTNAME_UPDATES))
672 return connman_settings.allow_hostname_updates;
674 if (g_str_equal(key, CONF_ALLOW_DOMAINNAME_UPDATES))
675 return connman_settings.allow_domainname_updates;
677 if (g_str_equal(key, CONF_SINGLE_TECH))
678 return connman_settings.single_tech;
680 if (g_str_equal(key, CONF_PERSISTENT_TETHERING_MODE))
681 return connman_settings.persistent_tethering_mode;
683 if (g_str_equal(key, CONF_ENABLE_6TO4))
684 return connman_settings.enable_6to4;
686 if (g_str_equal(key, CONF_ENABLE_ONLINE_CHECK))
687 return connman_settings.enable_online_check;
689 if (g_str_equal(key, CONF_AUTO_CONNECT_ROAMING_SERVICES))
690 return connman_settings.auto_connect_roaming_services;
692 if (g_str_equal(key, CONF_ACD))
693 return connman_settings.acd;
695 if (g_str_equal(key, CONF_USE_GATEWAYS_AS_TIMESERVERS))
696 return connman_settings.use_gateways_as_timeservers;
701 char **connman_setting_get_string_list(const char *key)
703 if (g_str_equal(key, CONF_PREF_TIMESERVERS))
704 return connman_settings.pref_timeservers;
706 if (g_str_equal(key, CONF_FALLBACK_NAMESERVERS))
707 return connman_settings.fallback_nameservers;
709 if (g_str_equal(key, CONF_BLACKLISTED_INTERFACES))
710 return connman_settings.blacklisted_interfaces;
712 if (g_str_equal(key, CONF_TETHERING_TECHNOLOGIES))
713 return connman_settings.tethering_technologies;
718 unsigned int *connman_setting_get_uint_list(const char *key)
720 if (g_str_equal(key, CONF_AUTO_CONNECT_TECHS))
721 return connman_settings.auto_connect;
723 if (g_str_equal(key, CONF_FAVORITE_TECHS))
724 return connman_settings.favorite_techs;
726 if (g_str_equal(key, CONF_PREFERRED_TECHS))
727 return connman_settings.preferred_techs;
729 if (g_str_equal(key, CONF_ALWAYS_CONNECTED_TECHS))
730 return connman_settings.always_connected_techs;
735 unsigned int connman_timeout_input_request(void)
737 return connman_settings.timeout_inputreq;
740 unsigned int connman_timeout_browser_launch(void)
742 return connman_settings.timeout_browserlaunch;
745 int main(int argc, char *argv[])
747 GOptionContext *context;
748 GError *error = NULL;
749 DBusConnection *conn;
753 context = g_option_context_new(NULL);
754 g_option_context_add_main_entries(context, options, NULL);
756 if (!g_option_context_parse(context, &argc, &argv, &error)) {
758 g_printerr("%s\n", error->message);
761 g_printerr("An unknown error occurred\n");
765 g_option_context_free(context);
767 if (option_version) {
768 printf("%s\n", VERSION);
774 perror("Can't start daemon");
779 if (mkdir(STORAGEDIR, S_IRUSR | S_IWUSR | S_IXUSR |
780 S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) < 0) {
782 perror("Failed to create storage directory");
787 main_loop = g_main_loop_new(NULL, FALSE);
789 signal = setup_signalfd();
791 dbus_error_init(&err);
793 conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, CONNMAN_SERVICE, &err);
795 if (dbus_error_is_set(&err)) {
796 fprintf(stderr, "%s\n", err.message);
797 dbus_error_free(&err);
799 fprintf(stderr, "Can't register with system bus\n");
803 g_dbus_set_disconnect_function(conn, disconnect_callback, NULL, NULL);
805 __connman_log_init(argv[0], option_debug, option_detach,
806 option_backtrace, "Connection Manager", VERSION);
808 __connman_dbus_init(conn);
811 config_init(CONFIGMAINFILE);
813 config_init(option_config);
815 __connman_util_init();
816 __connman_inotify_init();
817 __connman_technology_init();
818 __connman_notifier_init();
819 __connman_agent_init();
820 __connman_service_init();
821 __connman_peer_service_init();
822 __connman_peer_init();
823 __connman_provider_init();
824 __connman_network_init();
825 __connman_config_init();
826 __connman_device_init(option_device, option_nodevice);
828 __connman_ippool_init();
829 __connman_firewall_init();
830 __connman_nat_init();
831 __connman_tethering_init();
832 __connman_counter_init();
833 __connman_manager_init();
834 __connman_stats_init();
835 __connman_clock_init();
837 __connman_ipconfig_init();
838 __connman_rtnl_init();
839 __connman_task_init();
840 __connman_proxy_init();
841 __connman_detect_init();
842 __connman_session_init();
843 __connman_timeserver_init();
844 __connman_connection_init();
846 __connman_plugin_init(option_plugin, option_noplugin);
848 __connman_resolver_init(option_dnsproxy);
849 __connman_rtnl_start();
850 __connman_dhcp_init();
851 __connman_dhcpv6_init();
852 __connman_wpad_init();
853 __connman_wispr_init();
854 __connman_rfkill_init();
855 __connman_machine_init();
857 g_free(option_config);
858 g_free(option_device);
859 g_free(option_plugin);
860 g_free(option_nodevice);
861 g_free(option_noplugin);
863 g_main_loop_run(main_loop);
865 g_source_remove(signal);
867 __connman_machine_cleanup();
868 __connman_rfkill_cleanup();
869 __connman_wispr_cleanup();
870 __connman_wpad_cleanup();
871 __connman_dhcpv6_cleanup();
872 __connman_session_cleanup();
873 __connman_plugin_cleanup();
874 __connman_provider_cleanup();
875 __connman_connection_cleanup();
876 __connman_timeserver_cleanup();
877 __connman_detect_cleanup();
878 __connman_proxy_cleanup();
879 __connman_task_cleanup();
880 __connman_rtnl_cleanup();
881 __connman_resolver_cleanup();
883 __connman_clock_cleanup();
884 __connman_stats_cleanup();
885 __connman_config_cleanup();
886 __connman_manager_cleanup();
887 __connman_counter_cleanup();
888 __connman_tethering_cleanup();
889 __connman_nat_cleanup();
890 __connman_firewall_cleanup();
891 __connman_peer_service_cleanup();
892 __connman_peer_cleanup();
893 __connman_ippool_cleanup();
894 __connman_device_cleanup();
895 __connman_network_cleanup();
896 __connman_dhcp_cleanup();
897 __connman_service_cleanup();
898 __connman_agent_cleanup();
899 __connman_ipconfig_cleanup();
900 __connman_notifier_cleanup();
901 __connman_technology_cleanup();
902 __connman_inotify_cleanup();
904 __connman_util_cleanup();
905 __connman_dbus_cleanup();
907 __connman_log_cleanup(option_backtrace);
909 dbus_connection_unref(conn);
911 g_main_loop_unref(main_loop);
913 if (connman_settings.pref_timeservers)
914 g_strfreev(connman_settings.pref_timeservers);
916 g_free(connman_settings.auto_connect);
917 g_free(connman_settings.favorite_techs);
918 g_free(connman_settings.preferred_techs);
919 g_strfreev(connman_settings.fallback_nameservers);
920 g_strfreev(connman_settings.blacklisted_interfaces);
921 g_strfreev(connman_settings.tethering_technologies);
923 g_free(option_debug);