fix vlan interface bring up on boot

when the parent interface of a vlan interface is not up (yet), ip link cannot bring the vlan interface up
the vlan interface will be automatically brought up when the parent interface is up later
fix NixOS/nixpkgs#28620
This commit is contained in:
Youfu Zhang 2018-08-02 18:10:10 +08:00 committed by GitHub
parent cd794f4216
commit 939c6be54e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -473,7 +473,7 @@ let
# Remove Dead Interfaces
ip link show "${n}" >/dev/null 2>&1 && ip link delete "${n}"
ip link add link "${v.interface}" name "${n}" type vlan id "${toString v.id}"
ip link set "${n}" up
ip link set "${n}" up || true
'';
postStop = ''
ip link delete "${n}" || true