aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2018-03-29 21:28:55 +0300
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2018-03-29 21:29:37 +0300
commit029a17f3803127e2d9f41ccec2f715ba8a994af5 (patch)
treeb05e4586aaa407cb3d3d6e448227c7233e960c29 /main
parent1fe4ff55f34098d4cf756ab6c6065dabb41bb2a1 (diff)
downloadaports-029a17f3803127e2d9f41ccec2f715ba8a994af5.tar.bz2
aports-029a17f3803127e2d9f41ccec2f715ba8a994af5.tar.xz
Revert "main/vlan: check if subinterface already exists"
This reverts commit 6073409488faf0051dc1f188042f444bbd4c4743. Reason: bashism (trap ERR)
Diffstat (limited to 'main')
-rw-r--r--main/vlan/APKBUILD6
-rw-r--r--main/vlan/mvlan.pre-up13
-rw-r--r--main/vlan/vlan.pre-up15
3 files changed, 15 insertions, 19 deletions
diff --git a/main/vlan/APKBUILD b/main/vlan/APKBUILD
index 23dd52fcdc..268fd8a4e1 100644
--- a/main/vlan/APKBUILD
+++ b/main/vlan/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=vlan
pkgver=2.1
-pkgrel=1
+pkgrel=2
pkgdesc="Scripts for configuring VLAN network interfaces"
url="http://wiki.alpinelinux.org/wiki/Vlan"
arch="noarch"
@@ -31,6 +31,6 @@ package() {
done
}
sha512sums="f00c8521830b1472f1e71223943c14446d28f2667f7e2fd3690c8402c7d3f34982bc4d27201b3dc9c1eb9a635e38ea23dee6e044487615cbc68ba519d940c0f7 mvlan.post-down
-c2154978882b7c73324c32f7b899bf7c0a7f07fd379109d1f770c650e9b2755272598fd7b0e416027d135cc9a17d1a10d94f458effa627bd5f8193adf3d0b385 mvlan.pre-up
+955ccc68398ed2d515f794d5ef4164fec2dcfc4504e2e29d427c1687c8b9d6ecff1ea7247dc751963bb7be1db5025940fb66efef3fb6287aa19fe014088573ac mvlan.pre-up
7a6e74957d2fcfb04023d2cf8246e8889a780171f669ec37a56882276d96fb0219180b37cc51ecd87421bcbd0f0d489602423859a6f5605781f703cf143e5bae vlan.post-down
-3555e5f5ad3bad5e15d01309880fd4fa3cced63ed7def1c289186f18f1c7d53b67c3d3cc7490e90055b065ede7dc094d381cb0d4ae91ab83e13e4b2e281b2bf7 vlan.pre-up"
+54af6be8962a19f5cc3781ab6e42046c2017b58adc90464fe9e1aeea0e4151792920588c84285c727e104e3232adf1d79b0b7d5edfdd53a76b02a764af555e37 vlan.pre-up"
diff --git a/main/vlan/mvlan.pre-up b/main/vlan/mvlan.pre-up
index ba8cf24b46..8c6f67cbfa 100644
--- a/main/vlan/mvlan.pre-up
+++ b/main/vlan/mvlan.pre-up
@@ -12,11 +12,6 @@ esac
RAW_DEVICE="${IF_MVLAN_RAW_DEVICE:-${GUESSED_RAW_DEVICE:-}}"
-device_creation_error() {
- echo "Failed to create vlan device $IFACE on device $RAW_DEVICE with tag $VLAN_ID"
- exit 1
-}
-
if [ -z "$RAW_DEVICE" ]; then
echo "RAW_DEVICE for $IFACE is not set"
exit 1
@@ -27,7 +22,9 @@ if ! ip link show "$RAW_DEVICE" >/dev/null; then
exit 1
fi
-if ! ip link show "$IFACE" >/dev/null 2>&1; then
- ip link add link "$RAW_DEVICE" name "$IFACE" type macvlan || \
- device_creation_error
+ip link add link "$RAW_DEVICE" name "$IFACE" type macvlan
+
+if ! ip link show "$IFACE" >/dev/null; then
+ echo "Failed to create vlan device $IFACE on device $RAW_DEVICE with tag $VLAN_ID"
+ exit 1
fi
diff --git a/main/vlan/vlan.pre-up b/main/vlan/vlan.pre-up
index bdb07fb8ff..f72f7cb666 100644
--- a/main/vlan/vlan.pre-up
+++ b/main/vlan/vlan.pre-up
@@ -17,11 +17,6 @@ esac
RAW_DEVICE="${IF_VLAN_RAW_DEVICE:-${GUESSED_RAW_DEVICE:-}}"
VLAN_ID="$(expr ${IF_VLAN_ID:-${GUESSED_VLAN_ID:-0}} + 0 || :)"
-device_creation_error() {
- echo "Failed to create vlan device $IFACE on device $RAW_DEVICE with tag $VLAN_ID"
- exit 1
-}
-
if ! [ "$VLAN_ID" -gt 0 ]; then
echo "VLAN_ID for $IFACE is not set"
exit 1
@@ -41,8 +36,12 @@ if ! [ -d /proc/net/vlan ]; then
modprobe 8021q
fi
-trap "device_creation_error" ERR
-ip link set dev "$RAW_DEVICE" up
-if [ ! -e "/proc/net/vlan/${IFACE}" ]; then
+if ! [ -e /sys/class/net/$IFACE ]; then
+ ip link set dev "$RAW_DEVICE" up
ip link add link "$RAW_DEVICE" name "$IFACE" type vlan id "$VLAN_ID"
fi
+
+if ! ip link show "$IFACE" >/dev/null; then
+ echo "Failed to create vlan device $IFACE on device $RAW_DEVICE with tag $VLAN_ID"
+ exit 1
+fi