about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2018-05-25 17:16:42 +0200
committerSebastien Bacher <seb128@ubuntu.com>2018-05-25 17:16:42 +0200
commit88ceb148d6d095e97efde4a9b2e8b7cbea667ac3 (patch)
treeaf798307cf34d601c67a181c12086dd20d526013
parent6f3c5392b3ff9d52b8710b8a98a780edee62ba21 (diff)
* debian/patches/git_thunderbolt_connect.patch:
     - enable host to host connection through thunderbolt
-rw-r--r--debian/changelog7
-rw-r--r--debian/patches/git_thunderbolt_connect.patch108
-rw-r--r--debian/patches/series2
3 files changed, 117 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 1ae249f2..71d56127 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+network-manager (1.10.8-1ubuntu2) cosmic; urgency=medium
+
+  * debian/patches/git_thunderbolt_connect.patch:
+    - enable host to host connection through thunderbolt
+
+ -- Sebastien Bacher <seb128@ubuntu.com>  Fri, 25 May 2018 16:54:48 +0200
+
 network-manager (1.10.8-1ubuntu1) cosmic; urgency=medium
 
   * Merge with Debian (LP: #1758331). Remaining changes:
diff --git a/debian/patches/git_thunderbolt_connect.patch b/debian/patches/git_thunderbolt_connect.patch
new file mode 100644
index 00000000..f4d31e15
--- /dev/null
+++ b/debian/patches/git_thunderbolt_connect.patch
@@ -0,0 +1,108 @@
+From 89af7fbfa6cc4f43446b2f38c3ddd885b5be79f1 Mon Sep 17 00:00:00 2001
+From: Christian Kellner <christian@kellner.me>
+Date: Thu, 19 Apr 2018 14:05:52 +0200
+Subject: [PATCH] all: add support for thunderbolt networking
+
+Load the thunderbolt-net module if we see a host-to-host connection
+and configure the resulting ethernet connection automatically to be
+a link-local only one. The latter is done by setting a new udev
+property "NM_AUTO_DEFAULT_LINK_LOCAL_ONLY" which is picked up when
+we configure the connection for the device.
+
+https://github.com/NetworkManager/NetworkManager/pull/97
+---
+ Makefile.am                      |  4 +++-
+ data/90-nm-thunderbolt.rules     | 13 +++++++++++++
+ src/devices/nm-device-ethernet.c | 23 +++++++++++++++++++++++
+ 4 files changed, 41 insertions(+), 2 deletions(-)
+ create mode 100644 data/90-nm-thunderbolt.rules
+
+Index: network-manager-1.10.8/Makefile.am
+===================================================================
+--- network-manager-1.10.8.orig/Makefile.am
++++ network-manager-1.10.8/Makefile.am
+@@ -3714,7 +3714,8 @@ if WITH_UDEV_DIR
+ udevrulesdir = $(UDEV_DIR)/rules.d
+ udevrules_DATA = \
+ 	data/84-nm-drivers.rules \
+-	data/85-nm-unmanaged.rules
++	data/85-nm-unmanaged.rules \
++	data/90-nm-thunderbolt.rules
+ endif
+ 
+ data/server.conf: $(srcdir)/data/server.conf.in
+@@ -3729,6 +3730,7 @@ EXTRA_DIST += \
+ 	data/org.freedesktop.NetworkManager.service.in \
+ 	data/84-nm-drivers.rules \
+ 	data/85-nm-unmanaged.rules \
++	data/90-nm-thunderbolt.rules \
+ 	data/server.conf.in
+ 
+ CLEANFILES += \
+Index: network-manager-1.10.8/data/90-nm-thunderbolt.rules
+===================================================================
+--- /dev/null
++++ network-manager-1.10.8/data/90-nm-thunderbolt.rules
+@@ -0,0 +1,13 @@
++# Do not modify this file, it will get overwritten on updates.
++# To override or extend the rules place a file in /etc/udev/rules.d
++
++ACTION!="add", GOTO="nm_thunderbolt_end"
++
++# Load he thunderbolt-net driver if we a device of type thunderbolt_xdomain
++# is added.
++SUBSYSTEM=="thunderbolt", ENV{DEVTYPE}=="thunderbolt_xdomain", RUN{builtin}+="kmod load thunderbolt-net"
++
++# For all thunderbolt network devices, we want to enable link-local configuration
++SUBSYSTEM=="net", ENV{ID_NET_DRIVER}=="thunderbolt-net", ENV{NM_AUTO_DEFAULT_LINK_LOCAL_ONLY}="1"
++
++LABEL="nm_thunderbolt_end"
+Index: network-manager-1.10.8/src/devices/nm-device-ethernet.c
+===================================================================
+--- network-manager-1.10.8.orig/src/devices/nm-device-ethernet.c
++++ network-manager-1.10.8/src/devices/nm-device-ethernet.c
+@@ -51,6 +51,7 @@
+ #include "nm-device-factory.h"
+ #include "nm-core-internal.h"
+ #include "NetworkManagerUtils.h"
++#include "nm-utils/nm-udev-utils.h"
+ 
+ #include "introspection/org.freedesktop.NetworkManager.Device.Wired.h"
+ 
+@@ -1425,7 +1426,9 @@ new_default_connection (NMDevice *self)
+ 	NMConnection *connection;
+ 	NMSettingsConnection *const*connections;
+ 	NMSetting *setting;
++	struct udev_device *dev;
+ 	const char *perm_hw_addr;
++	const char *uprop = "0";
+ 	gs_free char *defname = NULL;
+ 	gs_free char *uuid = NULL;
+ 	gs_free char *machine_id = NULL;
+@@ -1470,6 +1473,26 @@ new_default_connection (NMDevice *self)
+ 	g_object_set (setting, NM_SETTING_WIRED_MAC_ADDRESS, perm_hw_addr, NULL);
+ 	nm_connection_add_setting (connection, setting);
+ 
++	/* Check if we should create a Link-Local only connection */
++	dev = nm_platform_link_get_udev_device (nm_device_get_platform (NM_DEVICE (self)), nm_device_get_ip_ifindex (self));
++	if (dev)
++		uprop = udev_device_get_property_value (dev, "NM_AUTO_DEFAULT_LINK_LOCAL_ONLY");
++
++	if (nm_udev_utils_property_as_boolean (uprop)) {
++		setting = nm_setting_ip4_config_new ();
++		g_object_set (setting,
++		              NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL,
++		              NULL);
++		nm_connection_add_setting (connection, setting);
++
++		setting = nm_setting_ip6_config_new ();
++		g_object_set (setting,
++		              NM_SETTING_IP_CONFIG_METHOD,  NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL,
++		              NM_SETTING_IP_CONFIG_MAY_FAIL, TRUE,
++		              NULL);
++		nm_connection_add_setting (connection, setting);
++	}
++
+ 	return connection;
+ }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index faca6370..27c82a36 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,3 +11,5 @@ libnm-Check-self-still-NMManager-or-not.patch
 #dns-manager-don-t-merge-split-DNS-search-domains.patch
 Read-system-connections-from-run.patch
 e91f1a7d2a6b8400b6b331d5b72287dcb5164a39.patch
+#upstream backport
+git_thunderbolt_connect.patch