diff options
Diffstat (limited to 'poky/meta/recipes-connectivity/connman')
28 files changed, 1978 insertions, 0 deletions
diff --git a/poky/meta/recipes-connectivity/connman/connman-conf.bb b/poky/meta/recipes-connectivity/connman/connman-conf.bb new file mode 100644 index 000000000..9a519ec86 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman-conf.bb @@ -0,0 +1,36 @@ +SUMMARY = "Connman config to setup wired interface on qemu machines" +DESCRIPTION = "This is the ConnMan configuration to set up a Wired \ +network interface for a qemu machine." +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +inherit systemd + +SRC_URI_append_qemuall = " file://wired.config \ + file://wired-setup \ + file://wired-connection.service \ +" +PR = "r2" + +S = "${WORKDIR}" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +FILES_${PN} = "${localstatedir}/* ${datadir}/*" + +do_install() { + #Configure Wired network interface in case of qemu* machines + if test -e ${WORKDIR}/wired.config && + test -e ${WORKDIR}/wired-setup && + test -e ${WORKDIR}/wired-connection.service; then + install -d ${D}${localstatedir}/lib/connman + install -m 0644 ${WORKDIR}/wired.config ${D}${localstatedir}/lib/connman + install -d ${D}${datadir}/connman + install -m 0755 ${WORKDIR}/wired-setup ${D}${datadir}/connman + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/wired-connection.service ${D}${systemd_system_unitdir} + sed -i -e 's|@SCRIPTDIR@|${datadir}/connman|g' ${D}${systemd_system_unitdir}/wired-connection.service + fi +} + +SYSTEMD_SERVICE_${PN}_qemuall = "wired-connection.service" diff --git a/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service b/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service new file mode 100644 index 000000000..48adfc08a --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service @@ -0,0 +1,10 @@ +[Unit] +Description=Setup a wired interface +Before=connman.service + +[Service] +Type=oneshot +ExecStart=@SCRIPTDIR@/wired-setup + +[Install] +WantedBy=network.target diff --git a/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup b/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup new file mode 100644 index 000000000..c46899ef3 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup @@ -0,0 +1,16 @@ +#!/bin/sh + +CONFIGF=/var/lib/connman/wired.config + +# Extract wired network config from /proc/cmdline +NET_CONF=`cat /proc/cmdline |sed -ne 's/^.*ip=\([^ ]*\):\([^ ]*\):\([^ ]*\):\([^ ]*\).*$/\1\/\4\/\3/p'` + +# Check if eth0 is already set via kernel cmdline +if [ "x$NET_CONF" = "x" ]; then + # Wired interface is not configured via kernel cmdline + # Remove connman config file template + rm -f ${CONFIGF} +else + # Setup a connman config accordingly + sed -i -e "s|^IPv4 =.*|IPv4 = ${NET_CONF}|" ${CONFIGF} +fi diff --git a/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config b/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config new file mode 100644 index 000000000..42998ce89 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config @@ -0,0 +1,9 @@ +[global] +Name = Wired +Description = Wired network configuration + +[service_ethernet] +Type = ethernet +IPv4 = +MAC = 52:54:00:12:34:56 +Nameservers = 8.8.8.8 diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/0001-Port-to-Gtk3.patch b/poky/meta/recipes-connectivity/connman/connman-gnome/0001-Port-to-Gtk3.patch new file mode 100644 index 000000000..c93e9b465 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman-gnome/0001-Port-to-Gtk3.patch @@ -0,0 +1,277 @@ +From a59b0fac02e74a971ac3f08bf28c17ce361a9526 Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen <jussi.kukkonen@intel.com> +Date: Wed, 2 Mar 2016 15:47:49 +0200 +Subject: [PATCH] Port to Gtk3 + +Some unused (or not useful) code was removed, functionality should stay +the same. + +Code still contains quite a few uses of deprecated API. + +Upstream-Status: Submitted +Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> +--- + applet/agent.c | 3 +-- + applet/main.c | 43 ------------------------------------------- + applet/status.c | 8 -------- + configure.ac | 3 +-- + properties/ethernet.c | 14 +++++++------- + properties/main.c | 2 +- + properties/wifi.c | 12 ++++++------ + 7 files changed, 16 insertions(+), 69 deletions(-) + +diff --git a/applet/agent.c b/applet/agent.c +index 65bed08..04fe86a 100644 +--- a/applet/agent.c ++++ b/applet/agent.c +@@ -126,7 +126,6 @@ static void request_input_dialog(GHashTable *request, + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); + gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE); + gtk_window_set_urgency_hint(GTK_WINDOW(dialog), TRUE); +- gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); + input->dialog = dialog; + + gtk_dialog_add_button(GTK_DIALOG(dialog), +@@ -139,7 +138,7 @@ static void request_input_dialog(GHashTable *request, + gtk_table_set_row_spacings(GTK_TABLE(table), 4); + gtk_table_set_col_spacings(GTK_TABLE(table), 20); + gtk_container_set_border_width(GTK_CONTAINER(table), 12); +- gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table); ++ gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area (GTK_DIALOG(dialog))), table); + + label = gtk_label_new(_("Please provide some network information:")); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); +diff --git a/applet/main.c b/applet/main.c +index f12d371..cd16285 100644 +--- a/applet/main.c ++++ b/applet/main.c +@@ -157,46 +157,6 @@ static void name_owner_changed(DBusGProxy *proxy, const char *name, + } + } + +-static void open_uri(GtkWindow *parent, const char *uri) +-{ +- GtkWidget *dialog; +- GdkScreen *screen; +- GError *error = NULL; +- gchar *cmdline; +- +- screen = gtk_window_get_screen(parent); +- +- cmdline = g_strconcat("xdg-open ", uri, NULL); +- +- if (gdk_spawn_command_line_on_screen(screen, +- cmdline, &error) == FALSE) { +- dialog = gtk_message_dialog_new(parent, +- GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, +- GTK_BUTTONS_CLOSE, "%s", error->message); +- gtk_dialog_run(GTK_DIALOG(dialog)); +- gtk_widget_destroy(dialog); +- g_error_free(error); +- } +- +- g_free(cmdline); +-} +- +-static void about_url_hook(GtkAboutDialog *dialog, +- const gchar *url, gpointer data) +-{ +- open_uri(GTK_WINDOW(dialog), url); +-} +- +-static void about_email_hook(GtkAboutDialog *dialog, +- const gchar *email, gpointer data) +-{ +- gchar *uri; +- +- uri = g_strconcat("mailto:", email, NULL); +- open_uri(GTK_WINDOW(dialog), uri); +- g_free(uri); +-} +- + static void about_callback(GtkWidget *item, gpointer user_data) + { + const gchar *authors[] = { +@@ -204,9 +164,6 @@ static void about_callback(GtkWidget *item, gpointer user_data) + NULL + }; + +- gtk_about_dialog_set_url_hook(about_url_hook, NULL, NULL); +- gtk_about_dialog_set_email_hook(about_email_hook, NULL, NULL); +- + gtk_show_about_dialog(NULL, "version", VERSION, + "copyright", "Copyright \xc2\xa9 2008 Intel Corporation", + "comments", _("A connection manager for the GNOME desktop"), +diff --git a/applet/status.c b/applet/status.c +index aed6f1e..015ff29 100644 +--- a/applet/status.c ++++ b/applet/status.c +@@ -102,8 +102,6 @@ static void icon_animation_start(IconAnimation *animation, + { + available = TRUE; + +- gtk_status_icon_set_tooltip(statusicon, NULL); +- + animation->start = start; + animation->end = (end == 0) ? animation->count - 1 : end; + +@@ -120,8 +118,6 @@ static void icon_animation_stop(IconAnimation *animation) + { + available = TRUE; + +- gtk_status_icon_set_tooltip(statusicon, NULL); +- + if (animation->id > 0) + g_source_remove(animation->id); + +@@ -251,8 +247,6 @@ void status_unavailable(void) + available = FALSE; + + gtk_status_icon_set_from_pixbuf(statusicon, pixbuf_notifier); +- gtk_status_icon_set_tooltip(statusicon, +- "Connection Manager daemon is not running"); + + gtk_status_icon_set_visible(statusicon, TRUE); + } +@@ -299,7 +293,6 @@ static void set_ready(gint signal) + + if (signal < 0) { + gtk_status_icon_set_from_pixbuf(statusicon, pixbuf_wired); +- gtk_status_icon_set_tooltip(statusicon, NULL); + return; + } + +@@ -311,7 +304,6 @@ static void set_ready(gint signal) + index = 4; + + gtk_status_icon_set_from_pixbuf(statusicon, pixbuf_signal[index]); +- gtk_status_icon_set_tooltip(statusicon, NULL); + } + + struct timeout_data { +diff --git a/configure.ac b/configure.ac +index b972e07..a4dad5d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -55,8 +55,7 @@ AC_SUBST(DBUS_LIBS) + DBUS_BINDING_TOOL="dbus-binding-tool" + AC_SUBST(DBUS_BINDING_TOOL) + +-PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8, dummy=yes, +- AC_MSG_ERROR(gtk+ >= 2.8 is required)) ++PKG_CHECK_MODULES(GTK, gtk+-3.0) + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + +diff --git a/properties/ethernet.c b/properties/ethernet.c +index 31db7a0..0b6b423 100644 +--- a/properties/ethernet.c ++++ b/properties/ethernet.c +@@ -82,7 +82,7 @@ void add_ethernet_switch_button(GtkWidget *mainbox, GtkTreeIter *iter, + gtk_container_set_border_width(GTK_CONTAINER(vbox), 24); + gtk_box_pack_start(GTK_BOX(mainbox), vbox, FALSE, FALSE, 0); + +- table = gtk_table_new(1, 1, TRUE); ++ table = gtk_table_new(1, 1, FALSE); + gtk_table_set_row_spacings(GTK_TABLE(table), 10); + gtk_table_set_col_spacings(GTK_TABLE(table), 10); + gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0); +@@ -136,7 +136,7 @@ void add_ethernet_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_d + gtk_container_set_border_width(GTK_CONTAINER(vbox), 24); + gtk_box_pack_start(GTK_BOX(mainbox), vbox, FALSE, FALSE, 0); + +- table = gtk_table_new(5, 5, TRUE); ++ table = gtk_table_new(5, 5, FALSE); + gtk_table_set_row_spacings(GTK_TABLE(table), 10); + gtk_table_set_col_spacings(GTK_TABLE(table), 10); + gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0); +@@ -144,9 +144,9 @@ void add_ethernet_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_d + label = gtk_label_new(_("Configuration:")); + gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 0, 1); + +- combo = gtk_combo_box_new_text(); +- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "DHCP"); +- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "MANUAL"); ++ combo = gtk_combo_box_text_new(); ++ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "DHCP"); ++ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "MANUAL"); + gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(combo), + separator_function, NULL, NULL); + gtk_table_attach_defaults(GTK_TABLE(table), combo, 2, 4, 0, 1); +@@ -219,7 +219,7 @@ void update_ethernet_ipv4(struct config_data *data, guint policy) + case CONNMAN_POLICY_DHCP: + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0); + for (i = 0; i < 3; i++) { +- gtk_entry_set_editable(GTK_ENTRY(entry[i]), 0); ++ gtk_editable_set_editable(GTK_EDITABLE(entry[i]), 0); + gtk_widget_set_sensitive(entry[i], 0); + gtk_entry_set_text(GTK_ENTRY(entry[i]), _("")); + } +@@ -227,7 +227,7 @@ void update_ethernet_ipv4(struct config_data *data, guint policy) + case CONNMAN_POLICY_MANUAL: + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 1); + for (i = 0; i < 3; i++) { +- gtk_entry_set_editable(GTK_ENTRY(entry[i]), 1); ++ gtk_editable_set_editable(GTK_EDITABLE(entry[i]), 1); + gtk_widget_set_sensitive(entry[i], 1); + } + break; +diff --git a/properties/main.c b/properties/main.c +index c05f443..6f76361 100644 +--- a/properties/main.c ++++ b/properties/main.c +@@ -429,7 +429,7 @@ static GtkWidget *create_interfaces(GtkWidget *window) + + scrolled = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), +- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); ++ GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), + GTK_SHADOW_OUT); + gtk_box_pack_start(GTK_BOX(hbox), scrolled, FALSE, TRUE, 0); +diff --git a/properties/wifi.c b/properties/wifi.c +index bd325ef..a5827e0 100644 +--- a/properties/wifi.c ++++ b/properties/wifi.c +@@ -125,7 +125,7 @@ void add_wifi_switch_button(GtkWidget *mainbox, GtkTreeIter *iter, + gtk_container_set_border_width(GTK_CONTAINER(vbox), 24); + gtk_box_pack_start(GTK_BOX(mainbox), vbox, FALSE, FALSE, 0); + +- table = gtk_table_new(1, 1, TRUE); ++ table = gtk_table_new(1, 1, FALSE); + gtk_table_set_row_spacings(GTK_TABLE(table), 10); + gtk_table_set_col_spacings(GTK_TABLE(table), 10); + gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0); +@@ -185,9 +185,9 @@ static void wifi_ipconfig(GtkWidget *table, struct config_data *data, GtkTreeIte + gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 3, 4); + data->ipv4.label[0] = label; + +- combo = gtk_combo_box_new_text(); +- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "DHCP"); +- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Manual"); ++ combo = gtk_combo_box_text_new(); ++ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "DHCP"); ++ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "Manual"); + + gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(combo), + separator_function, NULL, NULL); +@@ -335,14 +335,14 @@ void update_wifi_ipv4(struct config_data *data, guint policy) + case CONNMAN_POLICY_DHCP: + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0); + for (i = 0; i < 3; i++) { +- gtk_entry_set_editable(GTK_ENTRY(entry[i]), 0); ++ gtk_editable_set_editable(GTK_EDITABLE(entry[i]), 0); + gtk_widget_set_sensitive(entry[i], 0); + } + break; + case CONNMAN_POLICY_MANUAL: + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 1); + for (i = 0; i < 3; i++) { +- gtk_entry_set_editable(GTK_ENTRY(entry[i]), 1); ++ gtk_editable_set_editable(GTK_EDITABLE(entry[i]), 1); + gtk_widget_set_sensitive(entry[i], 1); + } + break; +-- +2.8.1 + diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/0001-Removed-icon-from-connman-gnome-about-applet.patch b/poky/meta/recipes-connectivity/connman/connman-gnome/0001-Removed-icon-from-connman-gnome-about-applet.patch new file mode 100644 index 000000000..7957500dc --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman-gnome/0001-Removed-icon-from-connman-gnome-about-applet.patch @@ -0,0 +1,35 @@ +From 5907a23ad2f49702960a33f9e2039552673eabc7 Mon Sep 17 00:00:00 2001 +From: Andrei Dinu <andrei.adrianx.dinu@intel.com> +Date: Mon, 17 Dec 2012 14:01:18 +0200 +Subject: [PATCH] Removed icon from connman-gnome "about" applet + +The connman-gnome "about" applet showed a picture that +can not be displayed. There is no designated picture +in connman-gnome to be used in the about section, so +it was removed. + +[OE-Core #2509] + +Upstream-Status: Pending + +Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com> +--- + applet/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/applet/main.c b/applet/main.c +index f12d371..c7b3c7f 100644 +--- a/applet/main.c ++++ b/applet/main.c +@@ -212,7 +212,7 @@ static void about_callback(GtkWidget *item, gpointer user_data) + "comments", _("A connection manager for the GNOME desktop"), + "authors", authors, + "translator-credits", _("translator-credits"), +- "logo-icon-name", "network-wireless", NULL); ++ NULL); + } + + static void settings_callback(GtkWidget *item, gpointer user_data) +-- +1.7.9.5 + diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/connman-gnome-fix-dbus-interface-name.patch b/poky/meta/recipes-connectivity/connman/connman-gnome/connman-gnome-fix-dbus-interface-name.patch new file mode 100644 index 000000000..f4049fa3e --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman-gnome/connman-gnome-fix-dbus-interface-name.patch @@ -0,0 +1,187 @@ +connman-gnome: fix dbus interface name + +This patch resolves following error: + +"connman-dbus.xml": "connman" is not a valid D-Bus interface name + +https://502552.bugs.gentoo.org/attachment.cgi?id=380652 + +Upstream-Status: Backport + +Signed-off-by: Chong Lu <Chong.Lu@windriver.com> +--- + common/connman-client.c | 24 ++++++++++++------------ + common/connman-client.h | 4 ++-- + common/connman-dbus.c | 6 +++--- + common/connman-dbus.xml | 2 +- + 4 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/common/connman-client.c b/common/connman-client.c +index c55e25c..9d818b2 100644 +--- a/common/connman-client.c ++++ b/common/connman-client.c +@@ -289,7 +289,7 @@ gboolean connman_client_set_ipv4(ConnmanClient *client, const gchar *device, + + g_value_init(&value, DBUS_TYPE_G_DICTIONARY); + g_value_set_boxed(&value, ipv4); +- ret = connman_set_property(proxy, "IPv4.Configuration", &value, NULL); ++ ret = net_connman_set_property(proxy, "IPv4.Configuration", &value, NULL); + + g_object_unref(proxy); + +@@ -317,7 +317,7 @@ void connman_client_set_powered(ConnmanClient *client, const gchar *device, + g_value_set_boolean(&value, powered); + + error = NULL; +- connman_set_property(proxy, "Powered", &value, &error); ++ net_connman_set_property(proxy, "Powered", &value, &error); + if( error ) + fprintf (stderr, "error: %s\n", error->message); + +@@ -325,7 +325,7 @@ void connman_client_set_powered(ConnmanClient *client, const gchar *device, + } + + void connman_client_scan(ConnmanClient *client, const gchar *device, +- connman_scan_reply callback, gpointer user_data) ++ net_connman_scan_reply callback, gpointer user_data) + { + ConnmanClientPrivate *priv = CONNMAN_CLIENT_GET_PRIVATE(client); + DBusGProxy *proxy; +@@ -339,7 +339,7 @@ void connman_client_scan(ConnmanClient *client, const gchar *device, + if (proxy == NULL) + return; + +- connman_scan_async(proxy, callback, user_data); ++ net_connman_scan_async(proxy, callback, user_data); + + g_object_unref(proxy); + } +@@ -353,7 +353,7 @@ gboolean connman_client_get_offline_status(ConnmanClient *client) + + DBG("client %p", client); + +- ret = connman_get_properties(priv->manager, &hash, NULL); ++ ret = net_connman_get_properties(priv->manager, &hash, NULL); + + if (ret == FALSE) + goto done; +@@ -375,7 +375,7 @@ void connman_client_set_offlinemode(ConnmanClient *client, gboolean status) + g_value_init(&value, G_TYPE_BOOLEAN); + g_value_set_boolean(&value, status); + +- connman_set_property(priv->manager, "OfflineMode", &value, NULL); ++ net_connman_set_property(priv->manager, "OfflineMode", &value, NULL); + } + + static gboolean network_disconnect(GtkTreeModel *model, GtkTreePath *path, +@@ -398,7 +398,7 @@ static gboolean network_disconnect(GtkTreeModel *model, GtkTreePath *path, + return TRUE; + + if (type == CONNMAN_TYPE_WIFI) +- connman_disconnect(proxy, NULL); ++ net_connman_disconnect(proxy, NULL); + + g_object_unref(proxy); + +@@ -422,13 +422,13 @@ void connman_client_connect(ConnmanClient *client, const gchar *network) + if (proxy == NULL) + return; + +- connman_connect(proxy, NULL); ++ net_connman_connect(proxy, NULL); + + g_object_unref(proxy); + } + + void connman_client_connect_async(ConnmanClient *client, const gchar *network, +- connman_connect_reply callback, gpointer userdata) ++ net_connman_connect_reply callback, gpointer userdata) + { + ConnmanClientPrivate *priv = CONNMAN_CLIENT_GET_PRIVATE(client); + DBusGProxy *proxy; +@@ -446,7 +446,7 @@ void connman_client_connect_async(ConnmanClient *client, const gchar *network, + if (proxy == NULL) + goto done; + +- connman_connect_async(proxy, callback, userdata); ++ net_connman_connect_async(proxy, callback, userdata); + + done: + return; +@@ -476,7 +476,7 @@ void connman_client_disconnect(ConnmanClient *client, const gchar *network) + if (proxy == NULL) + return; + +- connman_disconnect(proxy, NULL); ++ net_connman_disconnect(proxy, NULL); + + g_object_unref(proxy); + } +@@ -532,7 +532,7 @@ void connman_client_remove(ConnmanClient *client, const gchar *network) + if (proxy == NULL) + return; + +- connman_remove(proxy, NULL); ++ net_connman_remove(proxy, NULL); + + g_object_unref(proxy); + } +diff --git a/common/connman-client.h b/common/connman-client.h +index 9e2e6d5..98241de 100644 +--- a/common/connman-client.h ++++ b/common/connman-client.h +@@ -70,13 +70,13 @@ void connman_client_set_powered(ConnmanClient *client, const gchar *device, + gboolean connman_client_set_ipv4(ConnmanClient *client, const gchar *device, + struct ipv4_config *ipv4_config); + void connman_client_scan(ConnmanClient *client, const gchar *device, +- connman_scan_reply callback, gpointer user_data); ++ net_connman_scan_reply callback, gpointer user_data); + + void connman_client_connect(ConnmanClient *client, const gchar *network); + void connman_client_disconnect(ConnmanClient *client, const gchar *network); + gchar *connman_client_get_security(ConnmanClient *client, const gchar *network); + void connman_client_connect_async(ConnmanClient *client, const gchar *network, +- connman_connect_reply callback, gpointer userdata); ++ net_connman_connect_reply callback, gpointer userdata); + void connman_client_set_remember(ConnmanClient *client, const gchar *network, + gboolean remember); + +diff --git a/common/connman-dbus.c b/common/connman-dbus.c +index b82b3e1..543eb43 100644 +--- a/common/connman-dbus.c ++++ b/common/connman-dbus.c +@@ -655,15 +655,15 @@ DBusGProxy *connman_dbus_create_manager(DBusGConnection *conn, + + DBG("getting manager properties"); + +- connman_get_properties_async(proxy, manager_properties, store); ++ net_connman_get_properties_async(proxy, manager_properties, store); + + DBG("getting technologies"); + +- connman_get_technologies_async(proxy, manager_technologies, store); ++ net_connman_get_technologies_async(proxy, manager_technologies, store); + + DBG("getting services"); + +- connman_get_services_async(proxy, manager_services, store); ++ net_connman_get_services_async(proxy, manager_services, store); + + return proxy; + } +diff --git a/common/connman-dbus.xml b/common/connman-dbus.xml +index 56b9582..0199d52 100644 +--- a/common/connman-dbus.xml ++++ b/common/connman-dbus.xml +@@ -1,7 +1,7 @@ + <?xml version="1.0" encoding="UTF-8" ?> + + <node name="/"> +- <interface name="connman"> ++ <interface name="net.connman"> + <method name="GetProperties"> + <arg type="a{sv}" direction="out"/> + </method> +-- +1.9.1 + diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-01.png b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-01.png Binary files differnew file mode 100644 index 000000000..33247c1e2 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-01.png diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-02.png b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-02.png Binary files differnew file mode 100644 index 000000000..a94fb952f --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-02.png diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-03.png b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-03.png Binary files differnew file mode 100644 index 000000000..b5eb405a9 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-03.png diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-04.png b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-04.png Binary files differnew file mode 100644 index 000000000..be54419fa --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-04.png diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-05.png b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-05.png Binary files differnew file mode 100644 index 000000000..1c40ac9a1 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-05.png diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/null_check_for_ipv4_config.patch b/poky/meta/recipes-connectivity/connman/connman-gnome/null_check_for_ipv4_config.patch new file mode 100644 index 000000000..0421cda0b --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman-gnome/null_check_for_ipv4_config.patch @@ -0,0 +1,36 @@ +In networks that don't have a DHCP server configured, ipv4 address +allocation fails and the ipv4 structure doesn't get populated. When +the GUI is trying to read the ipv4_config.method field to see whether +it contains "dhcp" string, a segmentation fault is generated. + +Ethernet manual configuration behavior remains unchanged after this fix. + +Upstream-Status: Pending + +Signed-off-by: Emilia Ciobanu <emilia.maria.silvia.ciobanu@intel.com> +Index: git/properties/ethernet.c +=================================================================== +--- git.orig/properties/ethernet.c ++++ git/properties/ethernet.c +@@ -194,7 +194,7 @@ void add_ethernet_service(GtkWidget *mai + + data->button = button; + +- if (g_str_equal(ipv4_config.method, "dhcp") == TRUE) ++ if (!ipv4_config.method || g_str_equal(ipv4_config.method, "dhcp") == TRUE) + update_ethernet_ipv4(data, CONNMAN_POLICY_DHCP); + else + update_ethernet_ipv4(data, CONNMAN_POLICY_MANUAL); +Index: git/properties/wifi.c +=================================================================== +--- git.orig/properties/wifi.c ++++ git/properties/wifi.c +@@ -230,7 +230,7 @@ static void wifi_ipconfig(GtkWidget *tab + + data->ipv4_config = ipv4_config; + +- if (g_str_equal(ipv4_config.method, "dhcp") == TRUE) ++ if (!ipv4_config.method || g_str_equal(ipv4_config.method, "dhcp") == TRUE) + update_wifi_ipv4(data, CONNMAN_POLICY_DHCP); + else + update_wifi_ipv4(data, CONNMAN_POLICY_MANUAL); diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome_0.7.bb b/poky/meta/recipes-connectivity/connman/connman-gnome_0.7.bb new file mode 100644 index 000000000..a56bd3751 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman-gnome_0.7.bb @@ -0,0 +1,30 @@ +SUMMARY = "GTK+ frontend for the ConnMan network connection manager" +HOMEPAGE = "http://connman.net/" +SECTION = "libs/network" +LICENSE = "GPLv2 & LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \ + file://properties/main.c;beginline=1;endline=20;md5=50c77c81871308b033ab7a1504626afb \ + file://common/connman-dbus.c;beginline=1;endline=20;md5=de6b485c0e717a0236402d220187717a" + +DEPENDS = "gtk+3 dbus-glib dbus-glib-native intltool-native gettext-native" + +# 0.7 tag +SRCREV = "cf3c325b23dae843c5499a113591cfbc98acb143" +SRC_URI = "git://github.com/connectivity/connman-gnome.git \ + file://0001-Removed-icon-from-connman-gnome-about-applet.patch \ + file://null_check_for_ipv4_config.patch \ + file://images/* \ + file://connman-gnome-fix-dbus-interface-name.patch \ + file://0001-Port-to-Gtk3.patch \ + " + +S = "${WORKDIR}/git" + +inherit autotools-brokensep gtk-icon-cache pkgconfig distro_features_check +ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}" + +RDEPENDS_${PN} = "connman" + +do_install_append() { + install -m 0644 ${WORKDIR}/images/* ${D}/usr/share/icons/hicolor/22x22/apps/ +} diff --git a/poky/meta/recipes-connectivity/connman/connman.inc b/poky/meta/recipes-connectivity/connman/connman.inc new file mode 100644 index 000000000..2b03f9cb0 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman.inc @@ -0,0 +1,216 @@ +SUMMARY = "A daemon for managing internet connections within embedded devices" +DESCRIPTION = "The ConnMan project provides a daemon for managing \ +internet connections within embedded devices running the Linux \ +operating system. The Connection Manager is designed to be slim and \ +to use as few resources as possible, so it can be easily integrated. \ +It is a fully modular system that can be extended, through plug-ins, \ +to support all kinds of wired or wireless technologies. Also, \ +configuration methods, like DHCP and domain name resolving, are \ +implemented using plug-ins." +HOMEPAGE = "http://connman.net/" +BUGTRACKER = "https://01.org/jira/browse/CM" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ + file://src/main.c;beginline=1;endline=20;md5=486a279a6ab0c8d152bcda3a5b5edc36" + +inherit autotools pkgconfig systemd update-rc.d bluetooth update-alternatives + +DEPENDS = "dbus glib-2.0 ppp readline" + +INC_PR = "r20" + +EXTRA_OECONF += "\ + ac_cv_path_WPASUPPLICANT=${sbindir}/wpa_supplicant \ + ac_cv_path_PPPD=${sbindir}/pppd \ + --enable-debug \ + --enable-loopback \ + --enable-ethernet \ + --enable-tools \ + --disable-polkit \ + --enable-client \ +" + +PACKAGECONFIG ??= "wispr \ + ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd wifi', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ + iptables \ +" + +# If you want ConnMan to support VPN, add following statement into +# local.conf or distro config +# PACKAGECONFIG_append_pn-connman = " openvpn vpnc l2tp pptp" + +PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_unitdir}/system/ --with-tmpfilesdir=${sysconfdir}/tmpfiles.d/,--with-systemdunitdir='' --with-tmpfilesdir=''" +PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi, wpa-supplicant, wpa-supplicant" +PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, ${BLUEZ}, ${BLUEZ}" +PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono, ofono" +PACKAGECONFIG[tist] = "--enable-tist,--disable-tist," +PACKAGECONFIG[openvpn] = "--enable-openvpn --with-openvpn=${sbindir}/openvpn,--disable-openvpn,,openvpn" +PACKAGECONFIG[vpnc] = "--enable-vpnc --with-vpnc=${sbindir}/vpnc,--disable-vpnc,,vpnc" +PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2tp,,xl2tpd" +PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux" +# WISPr support for logging into hotspots, requires TLS +PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls," +PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,libmnl libnftnl,,kernel-module-nf-tables-ipv4 kernel-module-nft-chain-nat-ipv4 kernel-module-nft-chain-route-ipv4 kernel-module-nft-meta kernel-module-nft-masq-ipv4 kernel-module-nft-nat" +PACKAGECONFIG[iptables] = "--with-firewall=iptables ,,iptables,iptables" + +INITSCRIPT_NAME = "connman" +INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ." + +python __anonymous () { + systemd_packages = "${PN}" + pkgconfig = d.getVar('PACKAGECONFIG') + if ('openvpn' or 'vpnc' or 'l2tp' or 'pptp') in pkgconfig.split(): + systemd_packages += " ${PN}-vpn" + d.setVar('SYSTEMD_PACKAGES', systemd_packages) +} + +SYSTEMD_SERVICE_${PN} = "connman.service" +SYSTEMD_SERVICE_${PN}-vpn = "connman-vpn.service" +SYSTEMD_SERVICE_${PN}-wait-online = "connman-wait-online.service" + +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}" +ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.connman','',d)}" +ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}" + +do_install_append() { + if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/connman ${D}${sysconfdir}/init.d/connman + sed -i s%@DATADIR@%${datadir}% ${D}${sysconfdir}/init.d/connman + fi + + install -d ${D}${bindir} + install -m 0755 ${B}/tools/*-test ${D}${bindir} + if [ -e ${B}/tools/wispr ]; then + install -m 0755 ${B}/tools/wispr ${D}${bindir} + fi + install -m 0755 ${B}/client/connmanctl ${D}${bindir} + + # We don't need to package an empty directory + rmdir --ignore-fail-on-non-empty ${D}${libdir}/connman/scripts + + # Automake 1.12 won't install empty directories, but we need the + # plugins directory to be present for ownership + mkdir -p ${D}${libdir}/connman/plugins + + # For read-only filesystem, do not create links during bootup + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + ln -sf ../run/connman/resolv.conf ${D}${sysconfdir}/resolv-conf.connman + fi +} + +# These used to be plugins, but now they are core +RPROVIDES_${PN} = "\ + connman-plugin-loopback \ + connman-plugin-ethernet \ + ${@bb.utils.contains('PACKAGECONFIG', 'bluetooth','connman-plugin-bluetooth', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'wifi','connman-plugin-wifi', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', '3g','connman-plugin-ofono', '', d)} \ + " + +RDEPENDS_${PN} = "\ + dbus \ + " + +PACKAGES_DYNAMIC += "^${PN}-plugin-.*" + +def add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, add_insane_skip): + plugintype = pkg.split( '-' )[-1] + if plugintype in depmap: + rdepends = map(lambda x: multilib_prefix + x, \ + depmap[plugintype].split()) + d.setVar("RDEPENDS_%s" % pkg, " ".join(rdepends)) + if add_insane_skip: + d.appendVar("INSANE_SKIP_%s" % pkg, "dev-so") + +python populate_packages_prepend() { + depmap = dict(pppd="ppp") + multilib_prefix = (d.getVar("MLPREFIX") or "") + + hook = lambda file,pkg,x,y,z: \ + add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, False) + plugin_dir = d.expand('${libdir}/connman/plugins/') + plugin_name = d.expand('${PN}-plugin-%s') + do_split_packages(d, plugin_dir, '^(.*).so$', plugin_name, \ + '${PN} plugin for %s', extra_depends='', hook=hook, prepend=True ) + + hook = lambda file,pkg,x,y,z: \ + add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, True) + plugin_dir = d.expand('${libdir}/connman/plugins-vpn/') + plugin_name = d.expand('${PN}-plugin-vpn-%s') + do_split_packages(d, plugin_dir, '^(.*).so$', plugin_name, \ + '${PN} VPN plugin for %s', extra_depends='', hook=hook, prepend=True ) +} + +PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client" + +FILES_${PN}-tools = "${bindir}/wispr" +RDEPENDS_${PN}-tools ="${PN}" + +FILES_${PN}-tests = "${bindir}/*-test" + +FILES_${PN}-client = "${bindir}/connmanctl" +RDEPENDS_${PN}-client ="${PN}" + +FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \ + ${libdir}/connman/plugins \ + ${sysconfdir} ${sharedstatedir} ${localstatedir} \ + ${base_bindir}/* ${base_sbindir}/* ${base_libdir}/*.so* ${datadir}/${PN} \ + ${datadir}/dbus-1/system-services/* \ + ${sysconfdir}/tmpfiles.d/connman_resolvconf.conf" + +FILES_${PN}-dev += "${libdir}/connman/*/*.la" + +PACKAGES =+ "${PN}-vpn ${PN}-wait-online" + +SUMMARY_${PN}-vpn = "A daemon for managing VPN connections within embedded devices" +DESCRIPTION_${PN}-vpn = "The ConnMan VPN provides a daemon for \ +managing VPN connections within embedded devices running the Linux \ +operating system. The connman-vpnd handles all the VPN connections \ +and starts/stops VPN client processes when necessary. The connman-vpnd \ +provides a DBus API for managing VPN connections. All the different \ +VPN technogies are implemented using plug-ins." +FILES_${PN}-vpn += "${sbindir}/connman-vpnd \ + ${sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf \ + ${datadir}/dbus-1/system-services/net.connman.vpn.service \ + ${systemd_unitdir}/system/connman-vpn.service" + +SUMMARY_${PN}-wait-online = "A program that will return once ConnMan has connected to a network" +DESCRIPTION_${PN}-wait-online = "A service that can be enabled so that \ +the system waits until a network connection is established." +FILES_${PN}-wait-online += "${sbindir}/connmand-wait-online \ + ${systemd_unitdir}/system/connman-wait-online.service" + +SUMMARY_${PN}-plugin-vpn-openvpn = "An OpenVPN plugin for ConnMan VPN" +DESCRIPTION_${PN}-plugin-vpn-openvpn = "The ConnMan OpenVPN plugin uses openvpn client \ +to create a VPN connection to OpenVPN server." +FILES_${PN}-plugin-vpn-openvpn += "${libdir}/connman/scripts/openvpn-script \ + ${libdir}/connman/plugins-vpn/openvpn.so" +RDEPENDS_${PN}-plugin-vpn-openvpn += "${PN}-vpn" +RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','openvpn','${PN}-plugin-vpn-openvpn', '', d)}" + +SUMMARY_${PN}-plugin-vpn-vpnc = "A vpnc plugin for ConnMan VPN" +DESCRIPTION_${PN}-plugin-vpn-vpnc = "The ConnMan vpnc plugin uses vpnc client \ +to create a VPN connection to Cisco3000 VPN Concentrator." +FILES_${PN}-plugin-vpn-vpnc += "${libdir}/connman/scripts/openconnect-script \ + ${libdir}/connman/plugins-vpn/vpnc.so" +RDEPENDS_${PN}-plugin-vpn-vpnc += "${PN}-vpn" +RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','vpnc','${PN}-plugin-vpn-vpnc', '', d)}" + +SUMMARY_${PN}-plugin-vpn-l2tp = "A L2TP plugin for ConnMan VPN" +DESCRIPTION_${PN}-plugin-vpn-l2tp = "The ConnMan L2TP plugin uses xl2tpd daemon \ +to create a VPN connection to L2TP server." +FILES_${PN}-plugin-vpn-l2tp += "${libdir}/connman/scripts/libppp-plugin.so* \ + ${libdir}/connman/plugins-vpn/l2tp.so" +RDEPENDS_${PN}-plugin-vpn-l2tp += "${PN}-vpn" +RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','l2tp','${PN}-plugin-vpn-l2tp', '', d)}" + +SUMMARY_${PN}-plugin-vpn-pptp = "A PPTP plugin for ConnMan VPN" +DESCRIPTION_${PN}-plugin-vpn-pptp = "The ConnMan PPTP plugin uses pptp-linux client \ +to create a VPN connection to PPTP server." +FILES_${PN}-plugin-vpn-pptp += "${libdir}/connman/scripts/libppp-plugin.so* \ + ${libdir}/connman/plugins-vpn/pptp.so" +RDEPENDS_${PN}-plugin-vpn-pptp += "${PN}-vpn" +RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','pptp','${PN}-plugin-vpn-pptp', '', d)}" diff --git a/poky/meta/recipes-connectivity/connman/connman/0001-connman.service-stop-systemd-resolved-when-we-use-co.patch b/poky/meta/recipes-connectivity/connman/connman/0001-connman.service-stop-systemd-resolved-when-we-use-co.patch new file mode 100644 index 000000000..8e2e0bd02 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman/0001-connman.service-stop-systemd-resolved-when-we-use-co.patch @@ -0,0 +1,29 @@ +From 9f70b94ebf18f52c115634642652830fa77f27a1 Mon Sep 17 00:00:00 2001 +From: "Maxin B. John" <maxin.john@intel.com> +Date: Mon, 12 Jun 2017 16:52:39 +0300 +Subject: [PATCH] connman.service: stop systemd-resolved when we use connman + +Stop systemd-resolved service when we use connman as network manager. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Maxin B. John <maxin.john@intel.com> +--- + src/connman.service.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/connman.service.in b/src/connman.service.in +index 9f5c10f..dab48bc 100644 +--- a/src/connman.service.in ++++ b/src/connman.service.in +@@ -6,6 +6,7 @@ RequiresMountsFor=@localstatedir@/lib/connman + After=dbus.service network-pre.target systemd-sysusers.service + Before=network.target multi-user.target shutdown.target + Wants=network.target ++Conflicts=systemd-resolved.service + + [Service] + Type=dbus +-- +2.4.0 + diff --git a/poky/meta/recipes-connectivity/connman/connman/0001-giognutls-Fix-a-crash-using-wispr-over-TLS.patch b/poky/meta/recipes-connectivity/connman/connman/0001-giognutls-Fix-a-crash-using-wispr-over-TLS.patch new file mode 100644 index 000000000..f9080d4ba --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman/0001-giognutls-Fix-a-crash-using-wispr-over-TLS.patch @@ -0,0 +1,41 @@ +From 929fc9b7068100444e0ffcccd25841f78791e619 Mon Sep 17 00:00:00 2001 +From: Jian Liang <jianliang@tycoint.com> +Date: Fri, 15 Sep 2017 06:40:08 -0400 +Subject: [PATCH] gweb: Fix a crash using wispr over TLS +To: connman@lists.01.org +Cc: wagi@monom.org + +When gnutls_channel is instantiated, the gnutls_channel->established +has to be initiated as FALSE. Otherwise, check_handshake function +won't work. A random initial value 1 of gnutls_channel->established +will make check_handshake return G_IO_STATUS_NORMAL, when the channel +is actually not ready to be used. The observed behaviours are, + +- wispr is getting random errors in wispr_portal_web_result +- ConnMan crashes on exit after those random errors +- when wispr is luckly working, ConnMan doesn't crash on exit + +Signed-off-by: Jian Liang <jianliang@tycoint.com> + +--- +Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=73e53f3bd9e7debae86341f1eee7b97862a56a5e] +Signed-off-by: André Draszik <andre.draszik@jci.com> + gweb/giognutls.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gweb/giognutls.c b/gweb/giognutls.c +index 09dc9e7..c029a8b 100644 +--- a/gweb/giognutls.c ++++ b/gweb/giognutls.c +@@ -421,7 +421,7 @@ GIOChannel *g_io_channel_gnutls_new(int fd) + + DBG(""); + +- gnutls_channel = g_new(GIOGnuTLSChannel, 1); ++ gnutls_channel = g_new0(GIOGnuTLSChannel, 1); + + channel = (GIOChannel *) gnutls_channel; + +-- +2.7.4 + diff --git a/poky/meta/recipes-connectivity/connman/connman/0001-inet-Add-prefixlen-to-iproute_default_function.patch b/poky/meta/recipes-connectivity/connman/connman/0001-inet-Add-prefixlen-to-iproute_default_function.patch new file mode 100644 index 000000000..dd7b35674 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman/0001-inet-Add-prefixlen-to-iproute_default_function.patch @@ -0,0 +1,63 @@ +From 508dc60a1f0758ebc586b6b086478a176d493086 Mon Sep 17 00:00:00 2001 +From: Jian Liang <jianliang@tycoint.com> +Date: Thu, 5 Oct 2017 09:34:41 +0100 +Subject: [PATCH 1/4] inet: Add prefixlen to iproute_default_function +To: connman@lists.01.org +Cc: wagi@monom.org + +Add prefixlen parameter to this function in preparation for using +it also in creating subnet route later, e.g. + +default via 192.168.100.1 dev eth0 +192.168.100.0/24 dev eth0 + +Signed-off-by: Jian Liang <jianliang@tycoint.com> + +--- +Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=edda5b695de2ee79f02314abc9b46fdd46b388e1] +Signed-off-by: André Draszik <andre.draszik@jci.com> + src/inet.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/inet.c b/src/inet.c +index b887aa0..ab8aec8 100644 +--- a/src/inet.c ++++ b/src/inet.c +@@ -2796,7 +2796,7 @@ int __connman_inet_del_fwmark_rule(uint32_t table_id, int family, uint32_t fwmar + } + + static int iproute_default_modify(int cmd, uint32_t table_id, int ifindex, +- const char *gateway) ++ const char *gateway, unsigned char prefixlen) + { + struct __connman_inet_rtnl_handle rth; + unsigned char buf[sizeof(struct in6_addr)]; +@@ -2829,6 +2829,7 @@ static int iproute_default_modify(int cmd, uint32_t table_id, int ifindex, + rth.req.u.r.rt.rtm_protocol = RTPROT_BOOT; + rth.req.u.r.rt.rtm_scope = RT_SCOPE_UNIVERSE; + rth.req.u.r.rt.rtm_type = RTN_UNICAST; ++ rth.req.u.r.rt.rtm_dst_len = prefixlen; + + __connman_inet_rtnl_addattr_l(&rth.req.n, sizeof(rth.req), RTA_GATEWAY, + buf, len); +@@ -2860,7 +2861,7 @@ int __connman_inet_add_default_to_table(uint32_t table_id, int ifindex, + { + /* ip route add default via 1.2.3.4 dev wlan0 table 1234 */ + +- return iproute_default_modify(RTM_NEWROUTE, table_id, ifindex, gateway); ++ return iproute_default_modify(RTM_NEWROUTE, table_id, ifindex, gateway, 0); + } + + int __connman_inet_del_default_from_table(uint32_t table_id, int ifindex, +@@ -2868,7 +2869,7 @@ int __connman_inet_del_default_from_table(uint32_t table_id, int ifindex, + { + /* ip route del default via 1.2.3.4 dev wlan0 table 1234 */ + +- return iproute_default_modify(RTM_DELROUTE, table_id, ifindex, gateway); ++ return iproute_default_modify(RTM_DELROUTE, table_id, ifindex, gateway, 0); + } + + int __connman_inet_get_interface_ll_address(int index, int family, +-- +2.7.4 + diff --git a/poky/meta/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch b/poky/meta/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch new file mode 100644 index 000000000..e6f03e632 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch @@ -0,0 +1,35 @@ +From 4ddaf78dad5a9ee4a0658235f71b75132192123e Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 7 Apr 2012 18:52:12 -0700 +Subject: [PATCH] plugin.h: Change visibility to default for debug symbols + +gold refuses to link in undefined weak symbols which +have hidden visibility + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + + +Upstream-Status: Pending +--- + include/plugin.h | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/plugin.h b/include/plugin.h +index 692a4e5..a9361c3 100644 +--- a/include/plugin.h ++++ b/include/plugin.h +@@ -89,9 +89,9 @@ struct connman_plugin_desc { + #else + #define CONNMAN_PLUGIN_DEFINE(name, description, version, priority, init, exit) \ + extern struct connman_debug_desc __start___debug[] \ +- __attribute__ ((weak, visibility("hidden"))); \ ++ __attribute__ ((weak, visibility("default"))); \ + extern struct connman_debug_desc __stop___debug[] \ +- __attribute__ ((weak, visibility("hidden"))); \ ++ __attribute__ ((weak, visibility("default"))); \ + extern struct connman_plugin_desc connman_plugin_desc \ + __attribute__ ((visibility("default"))); \ + struct connman_plugin_desc connman_plugin_desc = { \ +-- +1.7.5.4 + diff --git a/poky/meta/recipes-connectivity/connman/connman/0001-session-Keep-track-of-addr-in-fw_snat-session.patch b/poky/meta/recipes-connectivity/connman/connman/0001-session-Keep-track-of-addr-in-fw_snat-session.patch new file mode 100644 index 000000000..f1b4d0aaa --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman/0001-session-Keep-track-of-addr-in-fw_snat-session.patch @@ -0,0 +1,112 @@ +From b5fd5945886fa1845db5c969424b63d894fe0376 Mon Sep 17 00:00:00 2001 +From: Jian Liang <jianliang@tycoint.com> +Date: Fri, 25 Aug 2017 10:02:16 -0400 +Subject: [PATCH 1/2] session: Keep track of addr in fw_snat & session +To: connman@lists.01.org +Cc: wagi@monom.org + +When there is more than one session in fw_snat's list of sessions, +fw_snat failed to be re-created when update-session-state is triggered +with new IP address. This is because index alone is not sufficient to +decide if fw_snat needs to be re-created. The solution here is to keep +a track of IP addr and use it to avoid false lookup of fw_snat. + +Signed-off-by: Jian Liang <jianliang@tycoint.com> + +--- +Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=f9e27d4abfcab5c80a38e0850b5ddb26277f97c1] +Signed-off-by: André Draszik <andre.draszik@jci.com> + src/session.c | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) + +diff --git a/src/session.c b/src/session.c +index 9e3c559..965ac06 100644 +--- a/src/session.c ++++ b/src/session.c +@@ -65,6 +65,7 @@ struct connman_session { + struct firewall_context *fw; + uint32_t mark; + int index; ++ char *addr; + char *gateway; + bool policy_routing; + bool snat_enabled; +@@ -79,6 +80,7 @@ struct fw_snat { + GSList *sessions; + int id; + int index; ++ char *addr; + struct firewall_context *fw; + }; + +@@ -200,7 +202,7 @@ static char *service2bearer(enum connman_service_type type) + return ""; + } + +-static struct fw_snat *fw_snat_lookup(int index) ++static struct fw_snat *fw_snat_lookup(int index, const char *addr) + { + struct fw_snat *fw_snat; + GSList *list; +@@ -208,8 +210,11 @@ static struct fw_snat *fw_snat_lookup(int index) + for (list = fw_snat_list; list; list = list->next) { + fw_snat = list->data; + +- if (fw_snat->index == index) ++ if (fw_snat->index == index) { ++ if (g_strcmp0(addr, fw_snat->addr) != 0) ++ continue; + return fw_snat; ++ } + } + return NULL; + } +@@ -224,6 +229,7 @@ static int fw_snat_create(struct connman_session *session, + + fw_snat->fw = __connman_firewall_create(); + fw_snat->index = index; ++ fw_snat->addr = g_strdup(addr); + + fw_snat->id = __connman_firewall_enable_snat(fw_snat->fw, + index, ifname, addr); +@@ -238,6 +244,7 @@ static int fw_snat_create(struct connman_session *session, + return 0; + err: + __connman_firewall_destroy(fw_snat->fw); ++ g_free(fw_snat->addr); + g_free(fw_snat); + return err; + } +@@ -393,7 +400,7 @@ static void del_nat_rules(struct connman_session *session) + return; + + session->snat_enabled = false; +- fw_snat = fw_snat_lookup(session->index); ++ fw_snat = fw_snat_lookup(session->index, session->addr); + + if (!fw_snat) + return; +@@ -420,8 +427,11 @@ static void add_nat_rules(struct connman_session *session) + if (!addr) + return; + ++ g_free(session->addr); ++ session->addr = g_strdup(addr); ++ + session->snat_enabled = true; +- fw_snat = fw_snat_lookup(index); ++ fw_snat = fw_snat_lookup(index, session->addr); + if (fw_snat) { + fw_snat_ref(session, fw_snat); + return; +@@ -502,6 +512,7 @@ static void free_session(struct connman_session *session) + g_free(session->info); + g_free(session->info_last); + g_free(session->gateway); ++ g_free(session->addr); + + g_free(session); + } +-- +2.7.4 + diff --git a/poky/meta/recipes-connectivity/connman/connman/0002-inet-Implement-subnet-route-creation-deletion-in-ipr.patch b/poky/meta/recipes-connectivity/connman/connman/0002-inet-Implement-subnet-route-creation-deletion-in-ipr.patch new file mode 100644 index 000000000..9c953e5d5 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman/0002-inet-Implement-subnet-route-creation-deletion-in-ipr.patch @@ -0,0 +1,69 @@ +From 08cda4004491d3971a8b9df937426c43800d15b1 Mon Sep 17 00:00:00 2001 +From: Jian Liang <jianliang@tycoint.com> +Date: Thu, 5 Oct 2017 09:37:06 +0100 +Subject: [PATCH 2/4] inet: Implement subnet route creation/deletion in + iproute_default_modify +To: connman@lists.01.org +Cc: wagi@monom.org + +- Calculate subnet address base on gateway address and prefixlen +- Differentiate creation of routes to gateway and subnet + +Signed-off-by: Jian Liang <jianliang@tycoint.com> + +--- +Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=ff7dcf91f12a2a237feebc6e606d0a8e92975528] +Signed-off-by: André Draszik <andre.draszik@jci.com> + src/inet.c | 22 +++++++++++++++++++--- + 1 file changed, 19 insertions(+), 3 deletions(-) + +diff --git a/src/inet.c b/src/inet.c +index ab8aec8..0ddb030 100644 +--- a/src/inet.c ++++ b/src/inet.c +@@ -2802,6 +2802,9 @@ static int iproute_default_modify(int cmd, uint32_t table_id, int ifindex, + unsigned char buf[sizeof(struct in6_addr)]; + int ret, len; + int family = connman_inet_check_ipaddress(gateway); ++ char *dst = NULL; ++ ++ DBG("gateway %s/%u table %u", gateway, prefixlen, table_id); + + switch (family) { + case AF_INET: +@@ -2814,7 +2817,19 @@ static int iproute_default_modify(int cmd, uint32_t table_id, int ifindex, + return -EINVAL; + } + +- ret = inet_pton(family, gateway, buf); ++ if (prefixlen) { ++ struct in_addr ipv4_subnet_addr, ipv4_mask; ++ ++ memset(&ipv4_subnet_addr, 0, sizeof(ipv4_subnet_addr)); ++ ipv4_mask.s_addr = htonl((0xffffffff << (32 - prefixlen)) & 0xffffffff); ++ ipv4_subnet_addr.s_addr = inet_addr(gateway); ++ ipv4_subnet_addr.s_addr &= ipv4_mask.s_addr; ++ ++ dst = g_strdup(inet_ntoa(ipv4_subnet_addr)); ++ } ++ ++ ret = inet_pton(family, dst ? dst : gateway, buf); ++ g_free(dst); + if (ret <= 0) + return -EINVAL; + +@@ -2831,8 +2846,9 @@ static int iproute_default_modify(int cmd, uint32_t table_id, int ifindex, + rth.req.u.r.rt.rtm_type = RTN_UNICAST; + rth.req.u.r.rt.rtm_dst_len = prefixlen; + +- __connman_inet_rtnl_addattr_l(&rth.req.n, sizeof(rth.req), RTA_GATEWAY, +- buf, len); ++ __connman_inet_rtnl_addattr_l(&rth.req.n, sizeof(rth.req), ++ prefixlen > 0 ? RTA_DST : RTA_GATEWAY, buf, len); ++ + if (table_id < 256) { + rth.req.u.r.rt.rtm_table = table_id; + } else { +-- +2.7.4 + diff --git a/poky/meta/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch b/poky/meta/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch new file mode 100644 index 000000000..059342771 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch @@ -0,0 +1,77 @@ +From 10b0d16d04b811b1ccd1f9b0cfe757bce8d876a1 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 6 Apr 2015 23:02:21 -0700 +Subject: [PATCH 2/3] resolve: musl does not implement res_ninit + +ported from +http://git.alpinelinux.org/cgit/aports/plain/testing/connman/libresolv.patch + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + gweb/gresolv.c | 33 ++++++++++++--------------------- + 1 file changed, 12 insertions(+), 21 deletions(-) + +diff --git a/gweb/gresolv.c b/gweb/gresolv.c +index 5cf7a9a..3ad8e70 100644 +--- a/gweb/gresolv.c ++++ b/gweb/gresolv.c +@@ -875,8 +875,6 @@ GResolv *g_resolv_new(int index) + resolv->index = index; + resolv->nameserver_list = NULL; + +- res_ninit(&resolv->res); +- + return resolv; + } + +@@ -916,8 +914,6 @@ void g_resolv_unref(GResolv *resolv) + + flush_nameservers(resolv); + +- res_nclose(&resolv->res); +- + g_free(resolv); + } + +@@ -1020,24 +1016,19 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const char *hostname, + debug(resolv, "hostname %s", hostname); + + if (!resolv->nameserver_list) { +- int i; +- +- for (i = 0; i < resolv->res.nscount; i++) { +- char buf[100]; +- int family = resolv->res.nsaddr_list[i].sin_family; +- void *sa_addr = &resolv->res.nsaddr_list[i].sin_addr; +- +- if (family != AF_INET && +- resolv->res._u._ext.nsaddrs[i]) { +- family = AF_INET6; +- sa_addr = &resolv->res._u._ext.nsaddrs[i]->sin6_addr; ++ FILE *f = fopen("/etc/resolv.conf", "r"); ++ if (f) { ++ char line[256], *s; ++ int i; ++ while (fgets(line, sizeof(line), f)) { ++ if (strncmp(line, "nameserver", 10) || !isspace(line[10])) ++ continue; ++ for (s = &line[11]; isspace(s[0]); s++); ++ for (i = 0; s[i] && !isspace(s[i]); i++); ++ s[i] = 0; ++ g_resolv_add_nameserver(resolv, s, 53, 0); + } +- +- if (family != AF_INET && family != AF_INET6) +- continue; +- +- if (inet_ntop(family, sa_addr, buf, sizeof(buf))) +- g_resolv_add_nameserver(resolv, buf, 53, 0); ++ fclose(f); + } + + if (!resolv->nameserver_list) +-- +2.5.1 + diff --git a/poky/meta/recipes-connectivity/connman/connman/0003-inet-Implement-APIs-for-creating-and-deleting-subnet.patch b/poky/meta/recipes-connectivity/connman/connman/0003-inet-Implement-APIs-for-creating-and-deleting-subnet.patch new file mode 100644 index 000000000..56ba5c3f4 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman/0003-inet-Implement-APIs-for-creating-and-deleting-subnet.patch @@ -0,0 +1,68 @@ +From a9243f13d6e1aadd69bfcc27f75f69c38be51677 Mon Sep 17 00:00:00 2001 +From: Jian Liang <jianliang@tycoint.com> +Date: Wed, 4 Oct 2017 17:30:17 +0100 +Subject: [PATCH 3/4] inet: Implement APIs for creating and deleting subnet + route +To: connman@lists.01.org +Cc: wagi@monom.org + +Signed-off-by: Jian Liang <jianliang@tycoint.com> + +--- +Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=3a15b0b7fccd053aff91da2cc68585509d0c509b] +Signed-off-by: André Draszik <andre.draszik@jci.com> + src/connman.h | 4 ++++ + src/inet.c | 14 ++++++++++++++ + 2 files changed, 18 insertions(+) + +diff --git a/src/connman.h b/src/connman.h +index 21b7080..da4446a 100644 +--- a/src/connman.h ++++ b/src/connman.h +@@ -240,7 +240,11 @@ int __connman_inet_rtnl_addattr32(struct nlmsghdr *n, size_t maxlen, + int __connman_inet_add_fwmark_rule(uint32_t table_id, int family, uint32_t fwmark); + int __connman_inet_del_fwmark_rule(uint32_t table_id, int family, uint32_t fwmark); + int __connman_inet_add_default_to_table(uint32_t table_id, int ifindex, const char *gateway); ++int __connman_inet_add_subnet_to_table(uint32_t table_id, int ifindex, ++ const char *gateway, unsigned char prefixlen); + int __connman_inet_del_default_from_table(uint32_t table_id, int ifindex, const char *gateway); ++int __connman_inet_del_subnet_from_table(uint32_t table_id, int ifindex, ++ const char *gateway, unsigned char prefixlen); + int __connman_inet_get_address_netmask(int ifindex, + struct sockaddr_in *address, struct sockaddr_in *netmask); + +diff --git a/src/inet.c b/src/inet.c +index 0ddb030..dcd1ab2 100644 +--- a/src/inet.c ++++ b/src/inet.c +@@ -2880,6 +2880,13 @@ int __connman_inet_add_default_to_table(uint32_t table_id, int ifindex, + return iproute_default_modify(RTM_NEWROUTE, table_id, ifindex, gateway, 0); + } + ++int __connman_inet_add_subnet_to_table(uint32_t table_id, int ifindex, ++ const char *gateway, unsigned char prefixlen) ++{ ++ /* ip route add 1.2.3.4/24 dev eth0 table 1234 */ ++ return iproute_default_modify(RTM_NEWROUTE, table_id, ifindex, gateway, prefixlen); ++} ++ + int __connman_inet_del_default_from_table(uint32_t table_id, int ifindex, + const char *gateway) + { +@@ -2888,6 +2895,13 @@ int __connman_inet_del_default_from_table(uint32_t table_id, int ifindex, + return iproute_default_modify(RTM_DELROUTE, table_id, ifindex, gateway, 0); + } + ++int __connman_inet_del_subnet_from_table(uint32_t table_id, int ifindex, ++ const char *gateway, unsigned char prefixlen) ++{ ++ /* ip route del 1.2.3.4/24 dev eth0 table 1234 */ ++ return iproute_default_modify(RTM_DELROUTE, table_id, ifindex, gateway, prefixlen); ++} ++ + int __connman_inet_get_interface_ll_address(int index, int family, + void *address) + { +-- +2.7.4 + diff --git a/poky/meta/recipes-connectivity/connman/connman/0004-session-Use-subnet-route-creation-and-deletion-APIs.patch b/poky/meta/recipes-connectivity/connman/connman/0004-session-Use-subnet-route-creation-and-deletion-APIs.patch new file mode 100644 index 000000000..ca213eb18 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman/0004-session-Use-subnet-route-creation-and-deletion-APIs.patch @@ -0,0 +1,77 @@ +From deb9372db8396da4f7cd20555ce7c9a8b3ad96bd Mon Sep 17 00:00:00 2001 +From: Jian Liang <jianliang@tycoint.com> +Date: Fri, 6 Oct 2017 11:40:16 +0100 +Subject: [PATCH 4/4] session: Use subnet route creation and deletion APIs +To: connman@lists.01.org +Cc: wagi@monom.org + +As subnet route is address and session specific in this case, so add +prefixlen into struct connman_session, and update it along with ipconfig. +Then use it in subnet route related APIs. + +Signed-off-by: Jian Liang <jianliang@tycoint.com> + +--- +Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=285f25ef6cc9e4a43dab83523f3e2eab4365ac26] +Signed-off-by: André Draszik <andre.draszik@jci.com> + src/session.c | 20 ++++++++++++++++---- + 1 file changed, 16 insertions(+), 4 deletions(-) + +diff --git a/src/session.c b/src/session.c +index 965ac06..7b7a14b 100644 +--- a/src/session.c ++++ b/src/session.c +@@ -67,6 +67,7 @@ struct connman_session { + int index; + char *addr; + char *gateway; ++ unsigned char prefixlen; + bool policy_routing; + bool snat_enabled; + }; +@@ -357,13 +358,17 @@ static void del_default_route(struct connman_session *session) + if (!session->gateway) + return; + +- DBG("index %d routing table %d default gateway %s", +- session->index, session->mark, session->gateway); ++ DBG("index %d routing table %d default gateway %s/%u", ++ session->index, session->mark, session->gateway, session->prefixlen); ++ ++ __connman_inet_del_subnet_from_table(session->mark, ++ session->index, session->gateway, session->prefixlen); + + __connman_inet_del_default_from_table(session->mark, + session->index, session->gateway); + g_free(session->gateway); + session->gateway = NULL; ++ session->prefixlen = 0; + session->index = -1; + } + +@@ -383,13 +388,20 @@ static void add_default_route(struct connman_session *session) + if (!session->gateway) + session->gateway = g_strdup(inet_ntoa(addr)); + +- DBG("index %d routing table %d default gateway %s", +- session->index, session->mark, session->gateway); ++ session->prefixlen = __connman_ipconfig_get_prefixlen(ipconfig); ++ ++ DBG("index %d routing table %d default gateway %s/%u", ++ session->index, session->mark, session->gateway, session->prefixlen); + + err = __connman_inet_add_default_to_table(session->mark, + session->index, session->gateway); + if (err < 0) + DBG("session %p %s", session, strerror(-err)); ++ ++ err = __connman_inet_add_subnet_to_table(session->mark, ++ session->index, session->gateway, session->prefixlen); ++ if (err < 0) ++ DBG("session add subnet route %p %s", session, strerror(-err)); + } + + static void del_nat_rules(struct connman_session *session) +-- +2.7.4 + diff --git a/poky/meta/recipes-connectivity/connman/connman/connman b/poky/meta/recipes-connectivity/connman/connman/connman new file mode 100644 index 000000000..c64fa0d71 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman/connman @@ -0,0 +1,83 @@ +#!/bin/sh + +DAEMON=/usr/sbin/connmand +PIDFILE=/var/run/connmand.pid +DESC="Connection Manager" + +if [ -f /etc/default/connman ] ; then + . /etc/default/connman +fi + +set -e + +nfsroot=0 + +exec 9<&0 < /proc/mounts +while read dev mtpt fstype rest; do + if test $mtpt = "/" ; then + case $fstype in + nfs | nfs4) + nfsroot=1 + break + ;; + *) + ;; + esac + fi +done + +do_start() { + EXTRA_PARAM="" + if test $nfsroot -eq 1 ; then + NET_DEVS=`cat /proc/net/dev | sed -ne 's/^\([a-zA-Z0-9 ]*\):.*$/\1/p'` + NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^ :]*\).*$/\1/p'` + + if [ ! -z "$NET_ADDR" ]; then + if [ "$NET_ADDR" = dhcp ]; then + ethn=`ifconfig | grep "^eth" | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"` + if [ ! -z "$ethn" ]; then + EXTRA_PARAM="-I $ethn" + fi + else + for i in $NET_DEVS; do + ADDR=`ifconfig $i | sed 's/addr://g' | sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'` + if [ "$NET_ADDR" = "$ADDR" ]; then + EXTRA_PARAM="-I $i" + break + fi + done + fi + fi + fi + if [ -f @DATADIR@/connman/wired-setup ] ; then + . @DATADIR@/connman/wired-setup + fi + $DAEMON $EXTRA_PARAM +} + +do_stop() { + start-stop-daemon --stop --name connmand --quiet +} + +case "$1" in + start) + echo "Starting $DESC" + do_start + ;; + stop) + echo "Stopping $DESC" + do_stop + ;; + restart|force-reload) + echo "Restarting $DESC" + do_stop + sleep 1 + do_start + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/poky/meta/recipes-connectivity/connman/connman/includes.patch b/poky/meta/recipes-connectivity/connman/connman/includes.patch new file mode 100644 index 000000000..55cb18793 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman/includes.patch @@ -0,0 +1,423 @@ +Fix various issues which cause problems under musl. + +Upstream-Status: Submitted +Signed-off-by: Ross Burton <ross.burton@intel.com> + +From 630516bcc0233b047f65665c003201ba6e77453d Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Tue, 9 Aug 2016 16:22:36 +0100 +Subject: [PATCH 1/3] Use AC_USE_SYSTEM_EXTENSIONS + +Instead of using #define _GNU_SOURCE in some source files which causes problems +when building with musl as more files need the define, simply use +AC_USE_SYSTEM_EXTENSIONS in configure.ac to get it defined globally. +--- + configure.ac | 1 + + gdhcp/client.c | 1 - + plugins/tist.c | 1 - + src/backtrace.c | 1 - + src/inet.c | 1 - + src/log.c | 1 - + src/ntp.c | 1 - + src/resolver.c | 1 - + src/rfkill.c | 1 - + src/stats.c | 1 - + src/timezone.c | 1 - + tools/stats-tool.c | 1 - + tools/tap-test.c | 1 - + tools/wispr.c | 1 - + vpn/plugins/vpn.c | 1 - + 15 files changed, 1 insertion(+), 14 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 6e66ab3..bacf5ec 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -20,6 +20,7 @@ AC_SUBST(abs_top_srcdir) + AC_SUBST(abs_top_builddir) + + AC_LANG_C ++AC_USE_SYSTEM_EXTENSIONS + + AC_PROG_CC + AM_PROG_CC_C_O +diff --git a/gdhcp/client.c b/gdhcp/client.c +index fbb40ab..3aeb089 100644 +--- a/gdhcp/client.c ++++ b/gdhcp/client.c +@@ -23,7 +23,6 @@ + #include <config.h> + #endif + +-#define _GNU_SOURCE + #include <stdio.h> + #include <errno.h> + #include <unistd.h> +diff --git a/plugins/tist.c b/plugins/tist.c +index ad5ef79..cc2800a 100644 +--- a/plugins/tist.c ++++ b/plugins/tist.c +@@ -23,7 +23,6 @@ + #include <config.h> + #endif + +-#define _GNU_SOURCE + #include <stdio.h> + #include <stdbool.h> + #include <stdlib.h> +diff --git a/src/backtrace.c b/src/backtrace.c +index 6a66c0a..4dbdda8 100644 +--- a/src/backtrace.c ++++ b/src/backtrace.c +@@ -24,7 +24,6 @@ + #include <config.h> + #endif + +-#define _GNU_SOURCE + #include <stdio.h> + #include <unistd.h> + #include <stdlib.h> +diff --git a/src/inet.c b/src/inet.c +index 69ded19..81d92c2 100644 +--- a/src/inet.c ++++ b/src/inet.c +@@ -25,7 +25,6 @@ + #include <config.h> + #endif + +-#define _GNU_SOURCE + #include <stdio.h> + #include <errno.h> + #include <unistd.h> +diff --git a/src/log.c b/src/log.c +index 9bae4a3..f7e82e5 100644 +--- a/src/log.c ++++ b/src/log.c +@@ -23,7 +23,6 @@ + #include <config.h> + #endif + +-#define _GNU_SOURCE + #include <stdio.h> + #include <unistd.h> + #include <stdarg.h> +diff --git a/src/ntp.c b/src/ntp.c +index dd246eb..db8ae96 100644 +--- a/src/ntp.c ++++ b/src/ntp.c +@@ -23,7 +23,6 @@ + #include <config.h> + #endif + +-#define _GNU_SOURCE + #include <errno.h> + #include <fcntl.h> + #include <unistd.h> +diff --git a/src/resolver.c b/src/resolver.c +index fbe4be7..ef61f92 100644 +--- a/src/resolver.c ++++ b/src/resolver.c +@@ -23,7 +23,6 @@ + #include <config.h> + #endif + +-#define _GNU_SOURCE + #include <stdio.h> + #include <errno.h> + #include <fcntl.h> +diff --git a/src/rfkill.c b/src/rfkill.c +index 2bfb092..af49d12 100644 +--- a/src/rfkill.c ++++ b/src/rfkill.c +@@ -23,7 +23,6 @@ + #include <config.h> + #endif + +-#define _GNU_SOURCE + #include <stdio.h> + #include <errno.h> + #include <fcntl.h> +diff --git a/src/stats.c b/src/stats.c +index 26343b1..cfcdc94 100644 +--- a/src/stats.c ++++ b/src/stats.c +@@ -23,7 +23,6 @@ + #include <config.h> + #endif + +-#define _GNU_SOURCE + #include <errno.h> + #include <sys/mman.h> + #include <sys/types.h> +diff --git a/src/timezone.c b/src/timezone.c +index e346b11..8e91267 100644 +--- a/src/timezone.c ++++ b/src/timezone.c +@@ -23,7 +23,6 @@ + #include <config.h> + #endif + +-#define _GNU_SOURCE + #include <errno.h> + #include <stdio.h> + #include <fcntl.h> +diff --git a/tools/stats-tool.c b/tools/stats-tool.c +index b076478..428d94b 100644 +--- a/tools/stats-tool.c ++++ b/tools/stats-tool.c +@@ -22,7 +22,6 @@ + #include <config.h> + #endif + +-#define _GNU_SOURCE + #include <sys/mman.h> + #include <sys/types.h> + #include <sys/stat.h> +diff --git a/tools/tap-test.c b/tools/tap-test.c +index fdc098a..57917f5 100644 +--- a/tools/tap-test.c ++++ b/tools/tap-test.c +@@ -23,7 +23,6 @@ + #include <config.h> + #endif + +-#define _GNU_SOURCE + #include <stdio.h> + #include <errno.h> + #include <fcntl.h> +diff --git a/tools/wispr.c b/tools/wispr.c +index d5f9341..e56dfc1 100644 +--- a/tools/wispr.c ++++ b/tools/wispr.c +@@ -23,7 +23,6 @@ + #include <config.h> + #endif + +-#define _GNU_SOURCE + #include <stdio.h> + #include <fcntl.h> + #include <unistd.h> +diff --git a/vpn/plugins/vpn.c b/vpn/plugins/vpn.c +index 9a42385..479c3a7 100644 +--- a/vpn/plugins/vpn.c ++++ b/vpn/plugins/vpn.c +@@ -23,7 +23,6 @@ + #include <config.h> + #endif + +-#define _GNU_SOURCE + #include <string.h> + #include <fcntl.h> + #include <unistd.h> +-- +2.8.1 + + +From b8b7878e6cb2a1ed4fcfa256f7e232511a40e3d9 Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Tue, 9 Aug 2016 15:37:50 +0100 +Subject: [PATCH 2/3] Check for in6_pktinfo.ipi6_addr explicitly + +Instead of assuming that just glibc has this structure, check for it at +configure as musl also has it. + +Based on work by Khem Raj <raj.khem@gmail.com>. +--- + configure.ac | 2 ++ + gdhcp/common.h | 5 +++-- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index bacf5ec..ad00456 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -186,6 +186,8 @@ AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [ + AC_CHECK_HEADERS([execinfo.h]) + AM_CONDITIONAL([BACKTRACE], [test "${ac_cv_header_execinfo_h}" = "yes"]) + ++AC_CHECK_MEMBERS([struct in6_pktinfo.ipi6_addr], [], [], [[#include <netinet/in.h>]]) ++ + AC_CHECK_FUNC(signalfd, dummy=yes, + AC_MSG_ERROR(signalfd support is required)) + +diff --git a/gdhcp/common.h b/gdhcp/common.h +index 75abc18..6899499 100644 +--- a/gdhcp/common.h ++++ b/gdhcp/common.h +@@ -19,6 +19,7 @@ + * + */ + ++#include <config.h> + #include <netinet/udp.h> + #include <netinet/ip.h> + +@@ -170,8 +171,8 @@ static const uint8_t dhcp_option_lengths[] = { + [OPTION_U32] = 4, + }; + +-/* already defined within netinet/in.h if using GNU compiler */ +-#ifndef __USE_GNU ++/* already defined within netinet/in.h if using glibc or musl */ ++#ifndef HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR + struct in6_pktinfo { + struct in6_addr ipi6_addr; /* src/dst IPv6 address */ + unsigned int ipi6_ifindex; /* send/recv interface index */ +-- +2.8.1 + + +From c0726e432fa0274a2b9c70179b03df6720972816 Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Tue, 9 Aug 2016 15:19:23 +0100 +Subject: [PATCH 3/3] Rationalise includes + +gweb/gresolv.c uses snprintf() and isspace() so it should include stdio.h and +ctype.h. + +tools/dnsproxy-test uses functions from stdio.h. + +musl warns when sys/ headers are included when the non-sys form should be used, +so switch sys/errno.h and so on to errno.h. + +musl also causes redefinition errors when pieces of the networking headers are +included, so remove the redundant includes. + +Based on work by Khem Raj <raj.khem@gmail.com>. +--- + gweb/gresolv.c | 2 ++ + plugins/wifi.c | 3 +-- + src/ippool.c | 1 - + src/iptables.c | 2 +- + src/tethering.c | 2 -- + tools/dhcp-test.c | 1 - + tools/dnsproxy-test.c | 1 + + tools/private-network-test.c | 2 +- + tools/tap-test.c | 2 +- + 9 files changed, 7 insertions(+), 9 deletions(-) + +diff --git a/gweb/gresolv.c b/gweb/gresolv.c +index 8a51a9f..d55027c 100644 +--- a/gweb/gresolv.c ++++ b/gweb/gresolv.c +@@ -23,11 +23,13 @@ + #include <config.h> + #endif + ++#include <ctype.h> + #include <errno.h> + #include <unistd.h> + #include <stdarg.h> + #include <string.h> + #include <stdlib.h> ++#include <stdio.h> + #include <resolv.h> + #include <sys/types.h> + #include <sys/socket.h> +diff --git a/plugins/wifi.c b/plugins/wifi.c +index 9d56671..148131d 100644 +--- a/plugins/wifi.c ++++ b/plugins/wifi.c +@@ -30,9 +30,8 @@ + #include <string.h> + #include <sys/ioctl.h> + #include <sys/socket.h> +-#include <linux/if_arp.h> +-#include <linux/wireless.h> + #include <net/ethernet.h> ++#include <linux/wireless.h> + + #ifndef IFF_LOWER_UP + #define IFF_LOWER_UP 0x10000 +diff --git a/src/ippool.c b/src/ippool.c +index cea1dcc..8a645da 100644 +--- a/src/ippool.c ++++ b/src/ippool.c +@@ -28,7 +28,6 @@ + #include <stdio.h> + #include <string.h> + #include <unistd.h> +-#include <sys/errno.h> + #include <sys/socket.h> + + #include "connman.h" +diff --git a/src/iptables.c b/src/iptables.c +index 5ef757a..82e3ac4 100644 +--- a/src/iptables.c ++++ b/src/iptables.c +@@ -28,7 +28,7 @@ + #include <stdio.h> + #include <string.h> + #include <unistd.h> +-#include <sys/errno.h> ++#include <errno.h> + #include <sys/socket.h> + #include <xtables.h> + #include <inttypes.h> +diff --git a/src/tethering.c b/src/tethering.c +index 3153349..ad062d5 100644 +--- a/src/tethering.c ++++ b/src/tethering.c +@@ -31,10 +31,8 @@ + #include <stdio.h> + #include <sys/ioctl.h> + #include <net/if.h> +-#include <linux/sockios.h> + #include <string.h> + #include <fcntl.h> +-#include <linux/if_tun.h> + #include <netinet/in.h> + #include <linux/if_bridge.h> + +diff --git a/tools/dhcp-test.c b/tools/dhcp-test.c +index c34e10a..eae66fc 100644 +--- a/tools/dhcp-test.c ++++ b/tools/dhcp-test.c +@@ -33,7 +33,6 @@ + #include <arpa/inet.h> + #include <net/route.h> + #include <net/ethernet.h> +-#include <linux/if_arp.h> + + #include <gdhcp/gdhcp.h> + +diff --git a/tools/dnsproxy-test.c b/tools/dnsproxy-test.c +index 551cae9..371e2e2 100644 +--- a/tools/dnsproxy-test.c ++++ b/tools/dnsproxy-test.c +@@ -24,6 +24,7 @@ + #endif + + #include <errno.h> ++#include <stdio.h> + #include <stdlib.h> + #include <string.h> + #include <unistd.h> +diff --git a/tools/private-network-test.c b/tools/private-network-test.c +index 3dd115b..2828bb3 100644 +--- a/tools/private-network-test.c ++++ b/tools/private-network-test.c +@@ -32,7 +32,7 @@ + #include <stdlib.h> + #include <string.h> + #include <signal.h> +-#include <sys/poll.h> ++#include <poll.h> + #include <sys/signalfd.h> + #include <unistd.h> + +diff --git a/tools/tap-test.c b/tools/tap-test.c +index 57917f5..cb3ee62 100644 +--- a/tools/tap-test.c ++++ b/tools/tap-test.c +@@ -28,7 +28,7 @@ + #include <fcntl.h> + #include <unistd.h> + #include <string.h> +-#include <sys/poll.h> ++#include <poll.h> + #include <sys/ioctl.h> + + #include <netinet/in.h> +-- +2.8.1 diff --git a/poky/meta/recipes-connectivity/connman/connman/no-version-scripts.patch b/poky/meta/recipes-connectivity/connman/connman/no-version-scripts.patch new file mode 100644 index 000000000..e96e38bcf --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman/no-version-scripts.patch @@ -0,0 +1,27 @@ +With binutils 2.27 on at least MIPS, connmand will crash on startup. This +appears to be due to the symbol visibilty scripts hiding symbols that stdio +looks up at runtime, resulting in it segfaulting. + +This certainly appears to be a bug in binutils 2.27 although the problem has +been known about for some time: + +https://sourceware.org/bugzilla/show_bug.cgi?id=17908 + +As the version scripts are only used to hide symbols from plugins we can safely +remove the scripts to work around the problem until binutils is fixed. + +Upstream-Status: Inappropriate +Signed-off-by: Ross Burton <ross.burton@intel.com> + +diff --git a/Makefile.am b/Makefile.am +index d70725c..76ae432 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -132,2 +132 @@ src_connmand_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) \ +-src_connmand_LDFLAGS = -Wl,--export-dynamic \ +- -Wl,--version-script=$(srcdir)/src/connman.ver ++src_connmand_LDFLAGS = -Wl,--export-dynamic +@@ -166,2 +165 @@ vpn_connman_vpnd_LDADD = gdbus/libgdbus-internal.la $(builtin_vpn_libadd) \ +-vpn_connman_vpnd_LDFLAGS = -Wl,--export-dynamic \ +- -Wl,--version-script=$(srcdir)/vpn/vpn.ver ++vpn_connman_vpnd_LDFLAGS = -Wl,--export-dynamic diff --git a/poky/meta/recipes-connectivity/connman/connman_1.35.bb b/poky/meta/recipes-connectivity/connman/connman_1.35.bb new file mode 100644 index 000000000..ff2118113 --- /dev/null +++ b/poky/meta/recipes-connectivity/connman/connman_1.35.bb @@ -0,0 +1,22 @@ +require connman.inc + +SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \ + file://0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch \ + file://0001-connman.service-stop-systemd-resolved-when-we-use-co.patch \ + file://connman \ + file://no-version-scripts.patch \ + file://includes.patch \ + file://0001-session-Keep-track-of-addr-in-fw_snat-session.patch \ + file://0001-giognutls-Fix-a-crash-using-wispr-over-TLS.patch \ + file://0001-inet-Add-prefixlen-to-iproute_default_function.patch \ + file://0002-inet-Implement-subnet-route-creation-deletion-in-ipr.patch \ + file://0003-inet-Implement-APIs-for-creating-and-deleting-subnet.patch \ + file://0004-session-Use-subnet-route-creation-and-deletion-APIs.patch \ + " +SRC_URI_append_libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch \ + " + +SRC_URI[md5sum] = "bae37b45ee9b3db5ec8115188f8a7652" +SRC_URI[sha256sum] = "66d7deb98371545c6e417239a9b3b3e3201c1529d08eedf40afbc859842cf2aa" + +RRECOMMENDS_${PN} = "connman-conf" |