Package: vlan
Version: 2.0
Tags: patch

Quack,

I was testing the new vlan version to see if it fixed some problem and I stumbled into this bug:
# ifup vlan255
+ STATEDIR=/run/network/vlan
+ mkdir -p /run/network/vlan
+ echo VLAN_PLUS_VID_NO_PAD
+ echo vlan255
+ sed s/vlan0*//
+ VLANID=255
+ [ -n eth-lan ]
+ which ip
+ [ ! -x /sbin/ip ]
+ ip link show dev eth-lan
+ [ ! -e /sys/class/net/vlan255 ]
+ ip link set up dev eth-lan
+ NAME_TYPE=DEV_PLUS_VID_NO_PAD
+ [ -r /run/network/vlan/name-type ]
+ cat /run/network/vlan/name-type
+ NAME_TYPE=VLAN_PLUS_VID_NO_PAD
+ NAME=vlan
+ ip link add link eth-lan name vlan type vlan id 255
RTNETLINK answers: File exists
+ [ -n  ]
Cannot find device "vlan255"
Failed to bring up vlan255.

It happens it is a simple variable name typo which is fixed using the attached patch.

Regards.
\_o<

--
Marc Dequènes
--- /etc/network/if-pre-up.d/vlan.orig	2017-06-08 18:29:35.520222039 +0900
+++ /etc/network/if-pre-up.d/vlan	2017-06-08 18:32:55.146127297 +0900
@@ -1,4 +1,5 @@
 #!/bin/sh
+set -x
 
 # Most of this stuff is to enable vlans
 
@@ -54,7 +55,7 @@
                 NAME="$(printf vlan%.4d "$VLANID")"
                 ;;
             VLAN_PLUS_VID_NO_PAD)
-                NAME="vlan$VLAN_ID"
+                NAME="vlan$VLANID"
                 ;;
             DEV_PLUS_VID)
                 NAME="$(printf %s.%.4d "$IF_VLAN_RAW_DEVICE" "$VLANID")"

Reply via email to