summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Desrochers <eric.desrochers@canonical.com>2018-05-15 20:14:30 +0000
committerAndrej Shadura <andrew.shadura@collabora.co.uk>2018-08-02 13:58:28 +0200
commit3db16ccdeb3d8c93f56fbe1e4bf7b08d0d71beb0 (patch)
treef7f777971c22915dda0f492236cafb15c97e215a
parentf2f33a15b1b4b5d09dcdbdbced0b20507a7fb07f (diff)
parent4f46208e18b7fa96ce0e38894c15616e1dd949de (diff)
Merge from Debian unstable
Remaining changes: - In vlan ifupdown pre-up script, instead of calling ip link up for raw device before creating vlan interface, do a full ifup for raw device. Otherwise, if raw device processes ifup after vlan device, the raw device may be taken down and back up, which removes all vlan routes and other configuration. - Correct previous patch, to work for ifupdown configuration where a vlan is configured but the vlan's raw device has no ifupdown config. - Revert change for lp1573272; instead fix by redesigning when vlan interfaces are created; after raw-device ifup, not during raw-device udev processing. - Add a udeb for vconfig in debian-installer. - Add udev hook and script for event based bring up. - Add support for biosdevname - Revert ifupdown integration as event based bringup is currently incompatible with the way ifupdown sets up bridges and vlans.
-rw-r--r--debian/changelog46
-rw-r--r--debian/network/if-post-down.d/vlan6
-rw-r--r--debian/network/if-pre-up.d/vlan11
-rw-r--r--debian/network/if-up.d/vlan8
-rw-r--r--debian/vlan-network-interface25
-rw-r--r--debian/vlan.vlan-network-interface.udev2
6 files changed, 87 insertions, 11 deletions
diff --git a/debian/changelog b/debian/changelog
index 2adb287..ae9f28e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,48 @@
+vlan (1.9-3.3ubuntu1) cosmic; urgency=low
+
+ * Merge from Debian unstable. Remaining changes:
+ - In vlan ifupdown pre-up script, instead of calling ip link up for
+ raw device before creating vlan interface, do a full ifup for raw
+ device. Otherwise, if raw device processes ifup after vlan device,
+ the raw device may be taken down and back up, which removes all vlan
+ routes and other configuration.
+ - Correct previous patch, to work for ifupdown configuration where a
+ vlan is configured but the vlan's raw device has no ifupdown config.
+ - Revert change for lp1573272; instead fix by redesigning when vlan
+ interfaces are created; after raw-device ifup, not during raw-device
+ udev processing.
+ - Add a udeb for vconfig in debian-installer.
+ - Add udev hook and script for event based bring up.
+ - Add support for biosdevname
+ - Revert ifupdown integration as event based bringup is currently
+ incompatible with the way ifupdown sets up bridges and vlans.
+
+ -- Eric Desrochers <eric.desrochers@canonical.com> Tue, 15 May 2018 20:14:30 +0000
+
+vlan (1.9-3.3) unstable; urgency=medium
+
+ [ Stéphane Graber ]
+ * Now that a vlan interface can be created by a udev hook and
+ ifupdown checks return codes from the scripts,
+ make sure to properly deal with an already existing interface.
+
+ [ Dan Streetman ]
+ * If VLAN is configured with higher MTU than raw device MTU, which can
+ happen if VLAN is ifup'ed before raw device, then increase raw device
+ MTU first so the VLAN ifup does not fail. (LP: #1224007)
+ * Allow ip-rp-filter to be 0, 1, or 2 instead of only 0 or 1
+ (LP: #1716964)
+
+ -- Andrew Shadura <andrewsh@debian.org> Sun, 26 Nov 2017 10:58:34 +0000
+
+vlan (1.9-3.2ubuntu6) bionic; urgency=medium
+
+ * Revert change for lp1573272; instead fix by redesigning when vlan
+ interfaces are created; after raw-device ifup, not during raw-device
+ udev processing. (LP: #1701023)
+
+ -- Dan Streetman <ddstreet@canonical.com> Thu, 19 Apr 2018 18:10:17 -0400
+
vlan (1.9-3.2ubuntu5) artful; urgency=medium
* Allow ip-rp-filter to be 0, 1, or 2 instead of only 0 or 1
@@ -272,3 +317,4 @@ vlan (1.0.4-1) unstable; urgency=low
closes:#115791
-- Ard van Breemen <ard@kwaak.net> Mon, 15 Oct 2001 19:06:59 +0200
+
diff --git a/debian/network/if-post-down.d/vlan b/debian/network/if-post-down.d/vlan
index 4d5afe7..5ef91bd 100644
--- a/debian/network/if-post-down.d/vlan
+++ b/debian/network/if-post-down.d/vlan
@@ -10,9 +10,15 @@ case "$IFACE" in
exit 0
;;
eth*.0*|bond*.0*|wlan*.0*|em*.0*|p[0-9]*.0*)
+ # Silently ignore interfaces which ifupdown handles on its own
+ # If IF_BRIDGE_PORTS is set, probably we're called by bridge-utils
+ [ -z "$IF_VLAN_RAW_DEVICE" -a -z "$IF_BRIDGE_PORTS" ] && exit 0
IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/;s/\(wlan[0-9][0-9]*\)\..*/\1/;s/\(em[0-9][0-9]*\)\..*/\1/;s/\(p[0-9][0-9]*\(p[0-9][0-9]*\)\?\(_[0-9][0-9]*\)\?\)\..*/\1/"`
;;
eth*.*|bond*.*|wlan*.*|em*.*|p[0-9]*.*)
+ # Silently ignore interfaces which ifupdown handles on its own
+ # If IF_BRIDGE_PORTS is set, probably we're called by bridge-utils
+ [ -z "$IF_VLAN_RAW_DEVICE" -a -z "$IF_BRIDGE_PORTS" ] && exit 0
IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/;s/\(wlan[0-9][0-9]*\)\..*/\1/;s/\(em[0-9][0-9]*\)\..*/\1/;s/\(p[0-9][0-9]*\(p[0-9][0-9]*\)\?\(_[0-9][0-9]*\)\?\)\..*/\1/"`
;;
# Test for vlan raw device (#196890, #292648)
diff --git a/debian/network/if-pre-up.d/vlan b/debian/network/if-pre-up.d/vlan
index c266e5b..9fcdd2b 100644
--- a/debian/network/if-pre-up.d/vlan
+++ b/debian/network/if-pre-up.d/vlan
@@ -16,11 +16,17 @@ case "$IFACE" in
VLANID=`echo $IFACE|sed "s/vlan0*//"`
;;
eth*.0*|bond*.0*|wlan*.0*|em*.0*|p[0-9]*.0*)
+ # Silently ignore interfaces which ifupdown handles on its own
+ # If IF_BRIDGE_PORTS is set, probably we're called by bridge-utils
+ [ -z "$IF_VLAN_RAW_DEVICE" -a -z "$IF_BRIDGE_PORTS" ] && exit 0
vconfig set_name_type DEV_PLUS_VID
VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g;s/bond[0-9][0-9]*\.0*//g;s/wlan[0-9][0-9]*\.0*//g;s/em[0-9][0-9]*\.0*//g;s/p[0-9][0-9]*\(p[0-9][0-9]*\)\?\(_[0-9][0-9]*\)\?\.0*//g"`
IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/;s/\(wlan[0-9][0-9]*\)\..*/\1/;s/\(em[0-9][0-9]*\)\..*/\1/;s/\(p[0-9][0-9]*\(p[0-9][0-9]*\)\?\(_[0-9][0-9]*\)\?\)\..*/\1/"`
;;
eth*.*|bond*.*|wlan*.*|em*.*|p[0-9]*.*)
+ # Silently ignore interfaces which ifupdown handles on its own
+ # If IF_BRIDGE_PORTS is set, probably we're called by bridge-utils
+ [ -z "$IF_VLAN_RAW_DEVICE" -a -z "$IF_BRIDGE_PORTS" ] && exit 0
vconfig set_name_type DEV_PLUS_VID_NO_PAD
VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g;s/bond[0-9][0-9]*\.0*//g;s/wlan[0-9][0-9]*\.0*//g;s/em[0-9][0-9]*\.0*//g;s/p[0-9][0-9]*\(p[0-9][0-9]*\)\?\(_[0-9][0-9]*\)\?\.0*//g"`
IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/;s/\(wlan[0-9][0-9]*\)\..*/\1/;s/\(em[0-9][0-9]*\)\..*/\1/;s/\(p[0-9][0-9]*\(p[0-9][0-9]*\)\?\(_[0-9][0-9]*\)\?\)\..*/\1/"`
@@ -60,9 +66,8 @@ if [ -n "$IF_VLAN_RAW_DEVICE" ] && [ ! -d /sys/class/net/$IFACE ]; then
exit 1
fi
if [ ! -e "/sys/class/net/$IFACE" ]; then
- # Try ifup for the raw device, if it fails then bring it up directly
- # this is required e.g. there is no configuration for the raw device
- ifup $IF_VLAN_RAW_DEVICE || ip link set up dev $IF_VLAN_RAW_DEVICE
+ # we cannot call ifup for the raw-device here, see LP: #1701023
+ ip link set up dev $IF_VLAN_RAW_DEVICE
vconfig add $IF_VLAN_RAW_DEVICE $VLANID
fi
fi
diff --git a/debian/network/if-up.d/vlan b/debian/network/if-up.d/vlan
new file mode 100644
index 0000000..15cf88b
--- /dev/null
+++ b/debian/network/if-up.d/vlan
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# after vlan-raw-device interface is ifup'ed, then
+# create any associated vlan interfaces
+# (LP: #1701032)
+if [ -x /lib/udev/vlan-network-interface ]; then
+ env INTERFACE=$IFACE /lib/udev/vlan-network-interface
+fi
diff --git a/debian/vlan-network-interface b/debian/vlan-network-interface
index 836b707..ce08eed 100644
--- a/debian/vlan-network-interface
+++ b/debian/vlan-network-interface
@@ -23,12 +23,23 @@ mkdir -p /run/network
for IFACE in $(ifquery --list --allow auto); do
IF_VLAN_RAW_DEVICE=$(ifquery $IFACE | sed -n -e's/^vlan[_-]raw[_-]device: //p')
- # Now that the environment is ready, call the pre-up script to create the vlan
- export IFACE IF_VLAN_RAW_DEVICE
-
- # Create the VLANs related to the interface
- if [ "$IF_VLAN_RAW_DEVICE" = "$INTERFACE" ] || \
- echo $IFACE | grep -q $INTERFACE; then
- /etc/network/if-pre-up.d/vlan
+ # If there is no vlan-raw-device defined, check for vlan-formatted name
+ # for example, eth1.123
+ if [ -z "$IF_VLAN_RAW_DEVICE" ]; then
+ IF_VLAN_RAW_DEVICE=${IFACE%%.*}
+ [ "$IFACE" = "$IF_VLAN_RAW_DEVICE" ] && continue
fi
+
+ # Check if this (vlan) $IFACE uses raw-device $INTERFACE
+ [ "$IF_VLAN_RAW_DEVICE" != "$INTERFACE" ] && continue
+
+ # If we're being called directly from udev, we only want to create the
+ # vlan interface if there is no associated ifupdown config for the
+ # raw-device; otherwise the ifup for the raw-device will create the
+ # vlan interface(s)
+ [ "$1" = "UDEV" ] && ifquery $IF_VLAN_RAW_DEVICE && continue
+
+ # Create the VLAN interface(s) related to the raw-device interface
+ export IFACE IF_VLAN_RAW_DEVICE
+ /etc/network/if-pre-up.d/vlan
done
diff --git a/debian/vlan.vlan-network-interface.udev b/debian/vlan.vlan-network-interface.udev
index 9c293a9..0799fe4 100644
--- a/debian/vlan.vlan-network-interface.udev
+++ b/debian/vlan.vlan-network-interface.udev
@@ -1 +1 @@
-ACTION=="add", SUBSYSTEM=="net", RUN+="vlan-network-interface"
+ACTION=="add", SUBSYSTEM=="net", RUN+="vlan-network-interface UDEV"