about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2014-09-26 00:43:12 -0700
committerWilliam A. Kennington III <william@wkennington.com>2014-09-26 00:45:38 -0700
commitd084245e74242227528ca59b2af2e0b50623c311 (patch)
treea799ecf207e5918fb9a4f706667f009f5b6753a2
parent691c8393ea4104de55baf0c7fc425a6abc83357f (diff)
downloadnixlib-d084245e74242227528ca59b2af2e0b50623c311.tar
nixlib-d084245e74242227528ca59b2af2e0b50623c311.tar.gz
nixlib-d084245e74242227528ca59b2af2e0b50623c311.tar.bz2
nixlib-d084245e74242227528ca59b2af2e0b50623c311.tar.lz
nixlib-d084245e74242227528ca59b2af2e0b50623c311.tar.xz
nixlib-d084245e74242227528ca59b2af2e0b50623c311.tar.zst
nixlib-d084245e74242227528ca59b2af2e0b50623c311.zip
iproute: Fix regressions introduced in 3.16.0
3.16.0 introduced a regression where vlan and veth devices could not be
created due to a check in the code for existing devices. This applies
the upstream patch which fixes the issue.

Additionally, this corrects the nixos network-interfaces task which now
needs to specify the name parameter when adding links.
-rw-r--r--nixos/modules/tasks/network-interfaces.nix6
-rw-r--r--pkgs/os-specific/linux/iproute/default.nix5
-rw-r--r--pkgs/os-specific/linux/iproute/device-checking.patch32
3 files changed, 39 insertions, 4 deletions
diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix
index 97b37b0714cd..a2423a2bd304 100644
--- a/nixos/modules/tasks/network-interfaces.nix
+++ b/nixos/modules/tasks/network-interfaces.nix
@@ -760,7 +760,7 @@ in
               # Remove Dead Interfaces
               ip link show "${n}" >/dev/null 2>&1 && ip link delete "${n}"
 
-              ip link add "${n}" type bond
+              ip link add name "${n}" type bond
 
               # !!! There must be a better way to wait for the interface
               while [ ! -d /sys/class/net/${n} ]; do sleep 0.1; done;
@@ -798,7 +798,7 @@ in
             script = ''
               # Remove Dead Interfaces
               ip link show "${n}" >/dev/null 2>&1 && ip link delete "${n}"
-              ip link add "${n}" type sit \
+              ip link add name "${n}" type sit \
                 ${optionalString (v.remote != null) "remote \"${v.remote}\""} \
                 ${optionalString (v.local != null) "local \"${v.local}\""} \
                 ${optionalString (v.ttl != null) "ttl ${toString v.ttl}"} \
@@ -824,7 +824,7 @@ in
             script = ''
               # Remove Dead Interfaces
               ip link show "${n}" >/dev/null 2>&1 && ip link delete "${n}"
-              ip link add link "${v.interface}" "${n}" type vlan id "${toString v.id}"
+              ip link add link "${v.interface}" name "${n}" type vlan id "${toString v.id}"
               ip link set "${n}" up
             '';
             postStop = ''
diff --git a/pkgs/os-specific/linux/iproute/default.nix b/pkgs/os-specific/linux/iproute/default.nix
index b10b513f2952..cf602a46f81d 100644
--- a/pkgs/os-specific/linux/iproute/default.nix
+++ b/pkgs/os-specific/linux/iproute/default.nix
@@ -8,7 +8,10 @@ stdenv.mkDerivation rec {
     sha256 = "0ybv29m88lccpfrh2dgiqash4c3gfvwwpx9kakvnc8c71rn8l2hz";
   };
 
-  patch = [ "vpnc.patch" ];
+  patch = [
+    ./vpnc.patch
+    ./device-checking.patch # Remove after 3.16.0
+  ];
 
   preConfigure =
     ''
diff --git a/pkgs/os-specific/linux/iproute/device-checking.patch b/pkgs/os-specific/linux/iproute/device-checking.patch
new file mode 100644
index 000000000000..a55423be38c3
--- /dev/null
+++ b/pkgs/os-specific/linux/iproute/device-checking.patch
@@ -0,0 +1,32 @@
+From f1b66ff83a0babbe99fef81b3a960d7a4ce8dbc6 Mon Sep 17 00:00:00 2001
+From: vadimk <vadim4j@gmail.com>
+Date: Sat, 30 Aug 2014 15:06:00 +0300
+Subject: ip link: Remove unnecessary device checking
+
+The real checking is performed later in iplink_modify(..) func which
+checks device existence if NLM_F_CREATE flag is set.
+
+Also it fixes the case when impossible to add veth link which was
+caused by 9a02651a87 (ip: check for missing dev arg when doing VF rate)
+because these devices are not exist yet.
+
+Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
+Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
+Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
+
+diff --git a/ip/iplink.c b/ip/iplink.c
+index 1a907d9..ea06871 100644
+--- a/ip/iplink.c
++++ b/ip/iplink.c
+@@ -593,8 +593,6 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
+ 				duparg2("dev", *argv);
+ 			*dev = *argv;
+ 			dev_index = ll_name_to_index(*dev);
+-			if (dev_index == 0)
+-				invarg("Unknown device", *argv);
+ 		}
+ 		argc--; argv++;
+ 	}
+-- 
+cgit v0.10.1
+