diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2018-06-18 14:50:45 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-06-19 07:08:42 +0000 |
commit | fcf202d3e511637897a5cade6ff6c1c04626e3d1 (patch) | |
tree | b9858923dc247fb7385b2acb8f705e3b2e26a89e | |
parent | 2dc65649625dc2e6a493993c0ba88de8d5438b55 (diff) | |
download | aports-fcf202d3e511637897a5cade6ff6c1c04626e3d1.tar.bz2 aports-fcf202d3e511637897a5cade6ff6c1c04626e3d1.tar.xz |
main/vlan: fix support for both ipv4 and ipv6 address on vlans
ref #9018
-rw-r--r-- | main/vlan/APKBUILD | 6 | ||||
-rw-r--r-- | main/vlan/vlan.pre-up | 15 |
2 files changed, 9 insertions, 12 deletions
diff --git a/main/vlan/APKBUILD b/main/vlan/APKBUILD index 268fd8a4e1..2f3a2b86f1 100644 --- a/main/vlan/APKBUILD +++ b/main/vlan/APKBUILD @@ -1,8 +1,8 @@ # Contributor: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=vlan -pkgver=2.1 -pkgrel=2 +pkgver=2.2 +pkgrel=0 pkgdesc="Scripts for configuring VLAN network interfaces" url="http://wiki.alpinelinux.org/wiki/Vlan" arch="noarch" @@ -33,4 +33,4 @@ package() { sha512sums="f00c8521830b1472f1e71223943c14446d28f2667f7e2fd3690c8402c7d3f34982bc4d27201b3dc9c1eb9a635e38ea23dee6e044487615cbc68ba519d940c0f7 mvlan.post-down 955ccc68398ed2d515f794d5ef4164fec2dcfc4504e2e29d427c1687c8b9d6ecff1ea7247dc751963bb7be1db5025940fb66efef3fb6287aa19fe014088573ac mvlan.pre-up 7a6e74957d2fcfb04023d2cf8246e8889a780171f669ec37a56882276d96fb0219180b37cc51ecd87421bcbd0f0d489602423859a6f5605781f703cf143e5bae vlan.post-down -54af6be8962a19f5cc3781ab6e42046c2017b58adc90464fe9e1aeea0e4151792920588c84285c727e104e3232adf1d79b0b7d5edfdd53a76b02a764af555e37 vlan.pre-up" +0ebf1556de28eeabad0cf9ddb6c38e7c25672ca28fd708e1d4670d65ecc8573df4f4f651cb9f59c1ab8fcedcc382c8e834521dcf8ed10a554567823301aac10f vlan.pre-up" diff --git a/main/vlan/vlan.pre-up b/main/vlan/vlan.pre-up index f72f7cb666..f45672b765 100644 --- a/main/vlan/vlan.pre-up +++ b/main/vlan/vlan.pre-up @@ -27,6 +27,10 @@ if [ -z "$RAW_DEVICE" ]; then exit 1 fi +if [ -e /sys/class/net/$IFACE ]; then + exit 0 +fi + if ! ip link show "$RAW_DEVICE" >/dev/null; then echo "Device $RAW_DEVICE for $IFACE does not exist" exit 1 @@ -36,12 +40,5 @@ if ! [ -d /proc/net/vlan ]; then modprobe 8021q fi -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 +ip link set dev "$RAW_DEVICE" up +ip link add link "$RAW_DEVICE" name "$IFACE" type vlan id "$VLAN_ID" |