diff options
-rwxr-xr-x | Makefile.am | 7 | ||||
-rwxr-xr-x | gdhcp/client.c | 51 | ||||
-rwxr-xr-x | gdhcp/gdhcp.h | 4 | ||||
-rwxr-xr-x | gsupplicant/supplicant.c | 13 | ||||
-rwxr-xr-x | packaging/connman.spec | 9 | ||||
-rw-r--r-- | resources/usr/share/dbus-1/system-services/net.connman.service | 4 | ||||
-rwxr-xr-x | src/connman.service.in | 2 | ||||
-rw-r--r-- | src/connman_tv.service.in | 2 | ||||
-rwxr-xr-x | src/inet.c | 7 | ||||
-rwxr-xr-x | src/iptables.c | 4 | ||||
-rwxr-xr-x | src/net.connman.service.in | 2 | ||||
-rwxr-xr-x | src/network.c | 11 | ||||
-rwxr-xr-x | src/rtnl.c | 5 | ||||
-rwxr-xr-x | src/service.c | 23 | ||||
-rwxr-xr-x | src/wispr.c | 5 | ||||
-rwxr-xr-x | vpn/connman-vpn.service.in | 2 | ||||
-rwxr-xr-x | vpn/net.connman.vpn.service.in | 3 |
17 files changed, 133 insertions, 21 deletions
diff --git a/Makefile.am b/Makefile.am index 95761e24..5be7625f 100755 --- a/Makefile.am +++ b/Makefile.am @@ -63,16 +63,15 @@ endif if SYSTEMD systemdunitdir = @SYSTEMD_UNITDIR@ - -systemdunit_DATA = src/connman.service +systemdunit_DATA = src/connman.service vpn/connman-vpn.service endif endif service_files_sources = src/connman.service.in src/net.connman.service.in \ - vpn/net.connman.vpn.service.in + vpn/net.connman.vpn.service.in vpn/connman-vpn.service.in service_files = src/connman.service src/net.connman.service \ - vpn/net.connman.vpn.service + vpn/net.connman.vpn.service vpn/connman-vpn.service plugin_LTLIBRARIES = diff --git a/gdhcp/client.c b/gdhcp/client.c index 106c7770..9b2de9db 100755 --- a/gdhcp/client.c +++ b/gdhcp/client.c @@ -156,6 +156,9 @@ struct _GDHCPClient { bool retransmit; struct timeval start_time; bool request_bcast; +#if defined TIZEN_EXT + gboolean init_reboot; +#endif }; static inline void debug(GDHCPClient *client, const char *format, ...) @@ -480,6 +483,9 @@ static int send_request(GDHCPClient *dhcp_client) init_packet(dhcp_client, &packet, DHCPREQUEST); packet.xid = dhcp_client->xid; +#if defined TIZEN_EXT + if (dhcp_client->init_reboot != TRUE) +#endif packet.secs = dhcp_attempt_secs(dhcp_client); if (dhcp_client->state == REQUESTING || dhcp_client->state == REBOOTING) @@ -1513,6 +1519,21 @@ static gboolean request_timeout(gpointer user_data) { GDHCPClient *dhcp_client = user_data; +#if defined TIZEN_EXT + if (dhcp_client->init_reboot) { + debug(dhcp_client, "DHCPREQUEST of INIT-REBOOT has failed"); + + /* Start DHCPDISCOVERY when DHCPREQUEST of INIT-REBOOT has failed */ + g_dhcp_client_set_address_known(dhcp_client, FALSE); + + dhcp_client->retry_times = 0; + dhcp_client->requested_ip = 0; + + g_dhcp_client_start(dhcp_client, dhcp_client->last_address); + + return FALSE; + } +#endif debug(dhcp_client, "request timeout (retries %d)", dhcp_client->retry_times); @@ -2362,6 +2383,18 @@ static gboolean listener_event(GIOChannel *channel, GIOCondition condition, remove_timeouts(dhcp_client); +#if defined TIZEN_EXT + if (dhcp_client->init_reboot) { + g_dhcp_client_set_address_known(dhcp_client, FALSE); + dhcp_client->timeout = g_idle_add_full( + G_PRIORITY_HIGH, + restart_dhcp_timeout, + dhcp_client, + NULL); + + break; + } +#endif dhcp_client->timeout = g_timeout_add_seconds_full( G_PRIORITY_HIGH, 3, restart_dhcp_timeout, @@ -2776,7 +2809,7 @@ int g_dhcp_client_start(GDHCPClient *dhcp_client, const char *last_address) if (addr == 0xFFFFFFFF || ((addr & LINKLOCAL_ADDR) == LINKLOCAL_ADDR)) { addr = 0; - } else { + } else if (dhcp_client->last_address != last_address) { g_free(dhcp_client->last_address); dhcp_client->last_address = g_strdup(last_address); } @@ -3205,3 +3238,19 @@ GSList *g_dhcpv6_copy_prefixes(GSList *prefixes) return copy; } + +#if defined TIZEN_EXT +void g_dhcp_client_set_address_known(GDHCPClient *dhcp_client, gboolean known) +{ + /* DHCPREQUEST during INIT-REBOOT state (rfc2131) + * 4.4.3 Initialization with known network address + * 4.3.2 DHCPREQUEST generated during INIT-REBOOT state + */ + debug(dhcp_client, "known network address (%d)", known); + + if (dhcp_client->init_reboot == known) + return; + + dhcp_client->init_reboot = known; +} +#endif diff --git a/gdhcp/gdhcp.h b/gdhcp/gdhcp.h index 22fa9f4b..59b562bf 100755 --- a/gdhcp/gdhcp.h +++ b/gdhcp/gdhcp.h @@ -238,6 +238,10 @@ void g_dhcp_server_set_save_ack_lease(GDHCPServer *dhcp_server, int dhcp_get_random(uint64_t *val); void dhcp_cleanup_random(void); +#if defined TIZEN_EXT +void g_dhcp_client_set_address_known(GDHCPClient *client, gboolean known); +#endif + #ifdef __cplusplus } #endif diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index 834be592..fc8fd3d9 100755 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -4216,8 +4216,13 @@ int g_supplicant_interface_scan(GSupplicantInterface *interface, data->interface = interface; data->path = g_strdup(interface->path); +#if defined TIZEN_EXT + data->interface->scan_callback = data->callback = callback; + data->interface->scan_data = data->user_data = user_data; +#else data->callback = callback; data->user_data = user_data; +#endif data->scan_params = scan_data; interface->scan_callback = callback; @@ -4485,8 +4490,10 @@ static void add_network_security_tls(DBusMessageIter *dict, if (!ssid->private_key_path) return; +#if !defined TIZEN_EXT if (!ssid->private_key_passphrase) return; +#endif if (ssid->ca_cert_path) supplicant_dbus_dict_append_basic(dict, "ca_cert", @@ -4495,9 +4502,11 @@ static void add_network_security_tls(DBusMessageIter *dict, supplicant_dbus_dict_append_basic(dict, "private_key", DBUS_TYPE_STRING, &ssid->private_key_path); +#if !defined TIZEN_EXT supplicant_dbus_dict_append_basic(dict, "private_key_passwd", DBUS_TYPE_STRING, &ssid->private_key_passphrase); +#endif supplicant_dbus_dict_append_basic(dict, "client_cert", DBUS_TYPE_STRING, &ssid->client_cert_path); @@ -4529,8 +4538,10 @@ static void add_network_security_peap(DBusMessageIter *dict, if (!ssid->private_key_path) return; +#if !defined TIZEN_EXT if (!ssid->private_key_passphrase) return; +#endif supplicant_dbus_dict_append_basic(dict, "client_cert", DBUS_TYPE_STRING, @@ -4540,9 +4551,11 @@ static void add_network_security_peap(DBusMessageIter *dict, DBUS_TYPE_STRING, &ssid->private_key_path); +#if !defined TIZEN_EXT supplicant_dbus_dict_append_basic(dict, "private_key_passwd", DBUS_TYPE_STRING, &ssid->private_key_passphrase); +#endif } diff --git a/packaging/connman.spec b/packaging/connman.spec index 93642e8d..47f8552e 100755 --- a/packaging/connman.spec +++ b/packaging/connman.spec @@ -4,7 +4,7 @@ Name: connman Version: 1.29 -Release: 9 +Release: 11 License: GPL-2.0+ Summary: Connection Manager Url: http://connman.net @@ -15,7 +15,6 @@ BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(libiptc) BuildRequires: pkgconfig(xtables) -BuildRequires: pkgconfig(gnutls) BuildRequires: pkgconfig(libsmack) BuildRequires: pkgconfig(tpkp-gnutls) %if %{with connman_openconnect} @@ -128,7 +127,8 @@ chmod +x bootstrap --enable-loopback \ --enable-ethernet \ --with-systemdunitdir=%{_libdir}/systemd/system \ - --enable-pie + --enable-pie \ + --disable-wispr make %{?_smp_mflags} @@ -146,6 +146,7 @@ cp src/connman_tv.service %{buildroot}%{_libdir}/systemd/system/connman.service %else %if "%{?_lib}" == "lib64" cp src/connman.service %{buildroot}%{_unitdir}/connman.service +cp vpn/connman-vpn.service %{buildroot}%{_unitdir}/connman-vpn.service %endif %endif @@ -197,9 +198,11 @@ systemctl daemon-reload %{_sysconfdir}/dbus-1/system.d/*.conf %attr(644,root,root) %{_libdir}/systemd/system/connman.service %attr(644,root,root) %{_libdir}/systemd/system/multi-user.target.wants/connman.service +%attr(644,root,root) %{_libdir}/systemd/system/connman-vpn.service %if "%{?_lib}" == "lib64" %attr(644,root,root) %{_unitdir}/connman.service %attr(644,root,root) %{_unitdir}/multi-user.target.wants/connman.service +%attr(644,root,root) %{_unitdir}/connman-vpn.service %endif %{_datadir}/license/connman diff --git a/resources/usr/share/dbus-1/system-services/net.connman.service b/resources/usr/share/dbus-1/system-services/net.connman.service index d7730d8a..9679c1be 100644 --- a/resources/usr/share/dbus-1/system-services/net.connman.service +++ b/resources/usr/share/dbus-1/system-services/net.connman.service @@ -1,5 +1,5 @@ [D-BUS Service] Name=net.connman -Exec=@sbindir@/connmand -n +Exec=/bin/false User=root -SystemdService=connman.service
\ No newline at end of file +SystemdService=connman.service diff --git a/src/connman.service.in b/src/connman.service.in index adf7a62a..503ec455 100755 --- a/src/connman.service.in +++ b/src/connman.service.in @@ -9,6 +9,8 @@ BusName=net.connman Restart=on-failure ExecStart=@sbindir@/connmand -n --noplugin vpn StandardOutput=null +CapabilityBoundingSet=~CAP_MAC_ADMIN +CapabilityBoundingSet=~CAP_MAC_OVERRIDE [Install] WantedBy=multi-user.target diff --git a/src/connman_tv.service.in b/src/connman_tv.service.in index 2922aa86..c0328467 100644 --- a/src/connman_tv.service.in +++ b/src/connman_tv.service.in @@ -7,6 +7,8 @@ BusName=net.connman RemainAfterExit=yes ExecStartPre=/usr/bin/dbus-send --system --dest=net.netconfig / net.netconfig.auto.activate ExecStart=/usr/sbin/connmand --noplugin vpn +CapabilityBoundingSet=~CAP_MAC_ADMIN +CapabilityBoundingSet=~CAP_MAC_OVERRIDE [Install] WantedBy=multi-user.target @@ -2706,7 +2706,14 @@ char **__connman_inet_get_running_interfaces(void) g_free(ifr); if (count < numif) + { + char **prev_result = result; result = g_try_realloc(result, (count + 1) * sizeof(char *)); + if (!result) { + g_free(prev_result); + goto error; + } + } return result; diff --git a/src/iptables.c b/src/iptables.c index dd1b2e63..c65f9efc 100755 --- a/src/iptables.c +++ b/src/iptables.c @@ -2311,6 +2311,10 @@ int __connman_iptables_commit(const char *table_name) return -EINVAL; repl = iptables_blob(table); +#if defined TIZEN_EXT + if(!repl) + return -ENOMEM; +#endif if (debug_enabled) dump_ipt_replace(repl); diff --git a/src/net.connman.service.in b/src/net.connman.service.in index f7f6a7c0..9679c1be 100755 --- a/src/net.connman.service.in +++ b/src/net.connman.service.in @@ -1,5 +1,5 @@ [D-BUS Service] Name=net.connman -Exec=@sbindir@/connmand -n +Exec=/bin/false User=root SystemdService=connman.service diff --git a/src/network.c b/src/network.c index ad677467..4b2ae113 100755 --- a/src/network.c +++ b/src/network.c @@ -1311,15 +1311,8 @@ static gboolean __connman_network_clear_associating_delayed(gpointer user_data) if (network->associating == FALSE && state_ipv4 == CONNMAN_SERVICE_STATE_ASSOCIATION && - state_ipv6 == CONNMAN_SERVICE_STATE_ASSOCIATION) { - __connman_service_ipconfig_indicate_state(service, - CONNMAN_SERVICE_STATE_IDLE, - CONNMAN_IPCONFIG_TYPE_IPV4); - - __connman_service_ipconfig_indicate_state(service, - CONNMAN_SERVICE_STATE_IDLE, - CONNMAN_IPCONFIG_TYPE_IPV6); - } + state_ipv6 == CONNMAN_SERVICE_STATE_ASSOCIATION) + connman_network_clear_associating(network); return FALSE; } @@ -100,6 +100,7 @@ static bool ether_blacklisted(const char *name) return false; } +#if !defined TIZEN_EXT static bool wext_interface(char *ifname) { struct iwreq wrq; @@ -121,6 +122,7 @@ static bool wext_interface(char *ifname) return true; } +#endif #if defined TIZEN_EXT static bool __connman_rtnl_is_cellular_device(const char *name) @@ -222,6 +224,8 @@ static void read_uevent(struct interface_data *interface) if (found_devtype) goto out; +#if !defined TIZEN_EXT + /* TIZEN does not use old wext interface */ /* We haven't got a DEVTYPE, let's check if it's a wireless device */ if (wext_interface(name)) { interface->service_type = CONNMAN_SERVICE_TYPE_WIFI; @@ -229,6 +233,7 @@ static void read_uevent(struct interface_data *interface) connman_error("%s runs an unsupported 802.11 driver", name); } +#endif out: g_free(name); diff --git a/src/service.c b/src/service.c index 9f197dd2..ca291199 100755 --- a/src/service.c +++ b/src/service.c @@ -1896,8 +1896,10 @@ static void state_changed(struct connman_service *service) if (!str) return; +#if !defined TIZEN_EXT if (!allow_property_changed(service)) return; +#endif connman_dbus_property_changed_basic(service->path, CONNMAN_SERVICE_INTERFACE, "State", @@ -2716,11 +2718,13 @@ static void append_wifi_ext_info(DBusMessageIter *dict, unsigned int maxrate; uint16_t frequency; const char *enc_mode; + gboolean passpoint; bssid = connman_network_get_bssid(network); maxrate = connman_network_get_maxrate(network); frequency = connman_network_get_frequency(network); enc_mode = connman_network_get_enc_mode(network); + passpoint = connman_network_get_is_hs20AP(network); snprintf(bssid_str, WIFI_BSSID_STR_LEN, "%02x:%02x:%02x:%02x:%02x:%02x", bssid[0], bssid[1], bssid[2], @@ -2734,6 +2738,8 @@ static void append_wifi_ext_info(DBusMessageIter *dict, DBUS_TYPE_UINT16, &frequency); connman_dbus_dict_append_basic(dict, "EncryptionMode", DBUS_TYPE_STRING, &enc_mode); + connman_dbus_dict_append_basic(dict, "Passpoint", + DBUS_TYPE_BOOLEAN, &passpoint); } #endif @@ -5144,6 +5150,10 @@ static void service_schedule_removed(struct connman_service *service) static bool allow_property_changed(struct connman_service *service) { +#if defined TIZEN_EXT + if (service->path == NULL) + return FALSE; +#endif if (g_hash_table_lookup_extended(services_notify->add, service->path, NULL, NULL)) { DBG("no property updates for service %p", service); @@ -6846,6 +6856,19 @@ int __connman_service_ipconfig_indicate_state(struct connman_service *service, is_connected_state(service, new_state)) nameserver_add_all(service); +#if defined TIZEN_EXT + int ret = service_indicate_state(service); + /*Sent the Ready changed signal again in case IPv4 IP set + after IPv6 IP set*/ + + if(ret == -EALREADY && type == CONNMAN_IPCONFIG_TYPE_IPV4 + && new_state == CONNMAN_SERVICE_STATE_READY) { + DBG("Notify IPv4 state new/old %d/%d", new_state,old_state); + state_changed(service); + } + + return ret; +#endif return service_indicate_state(service); } diff --git a/src/wispr.c b/src/wispr.c index ef4bdaba..330aa1d4 100755 --- a/src/wispr.c +++ b/src/wispr.c @@ -926,6 +926,11 @@ int __connman_wispr_start(struct connman_service *service, DBG("service %p", service); +#if defined TIZEN_EXT + if (connman_service_get_type(service) == CONNMAN_SERVICE_TYPE_CELLULAR) + return -EPERM; +#endif + if (!wispr_portal_list) return -EINVAL; diff --git a/vpn/connman-vpn.service.in b/vpn/connman-vpn.service.in index de65a70d..71abb570 100755 --- a/vpn/connman-vpn.service.in +++ b/vpn/connman-vpn.service.in @@ -8,6 +8,8 @@ Type=dbus BusName=net.connman.vpn ExecStart=@sbindir@/connman-vpnd -n StandardOutput=null +CapabilityBoundingSet=~CAP_MAC_ADMIN +CapabilityBoundingSet=~CAP_MAC_OVERRIDE [Install] WantedBy=multi-user.target diff --git a/vpn/net.connman.vpn.service.in b/vpn/net.connman.vpn.service.in index 94872013..8dcf2544 100755 --- a/vpn/net.connman.vpn.service.in +++ b/vpn/net.connman.vpn.service.in @@ -1,4 +1,5 @@ [D-BUS Service] Name=net.connman.vpn -Exec=@sbindir@/connman-vpnd -n +Exec=/bin/false User=root +SystemdService=connman-vpn.service |