diff -u vlan-1.9/debian/changelog vlan-1.9/debian/changelog --- vlan-1.9/debian/changelog +++ vlan-1.9/debian/changelog @@ -1,3 +1,11 @@ +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 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 diff -u vlan-1.9/debian/network/if-pre-up.d/vlan vlan-1.9/debian/network/if-pre-up.d/vlan --- vlan-1.9/debian/network/if-pre-up.d/vlan +++ vlan-1.9/debian/network/if-pre-up.d/vlan @@ -60,9 +60,8 @@ 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 -u vlan-1.9/debian/vlan-network-interface vlan-1.9/debian/vlan-network-interface --- vlan-1.9/debian/vlan-network-interface +++ vlan-1.9/debian/vlan-network-interface @@ -25,10 +25,21 @@ - # 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 -u vlan-1.9/debian/vlan.vlan-network-interface.udev vlan-1.9/debian/vlan.vlan-network-interface.udev --- vlan-1.9/debian/vlan.vlan-network-interface.udev +++ vlan-1.9/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" only in patch2: unchanged: --- vlan-1.9.orig/debian/network/if-up.d/vlan +++ vlan-1.9/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