Skip to content

Commit 700ca19

Browse files
committed
nixos-modules/microvm/interfaces: always use ip link delete
Fixes Github issue #302
1 parent c07e1dd commit 700ca19

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nixos-modules/microvm/interfaces.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ in
2626
set -eou pipefail
2727
'' + lib.concatMapStrings ({ id, mac, ... }: ''
2828
if [ -e /sys/class/net/${id} ]; then
29-
${pkgs.iproute2}/bin/ip tuntap del name '${id}' mode tap ${tapFlags}
29+
${pkgs.iproute2}/bin/ip link delete '${id}'
3030
fi
3131
3232
${pkgs.iproute2}/bin/ip tuntap add name '${id}' mode tap user '${user}' ${tapFlags}
@@ -35,7 +35,7 @@ in
3535
tap-down = ''
3636
set -ou pipefail
3737
'' + lib.concatMapStrings ({ id, mac, ... }: ''
38-
${pkgs.iproute2}/bin/ip tuntap del name '${id}' mode tap ${tapFlags}
38+
${pkgs.iproute2}/bin/ip link delete '${id}'
3939
'') tapInterfaces;
4040
}
4141
) (
@@ -44,7 +44,7 @@ in
4444
set -eou pipefail
4545
'' + lib.concatMapStrings ({ id, mac, macvtap, ... }: ''
4646
if [ -e /sys/class/net/${id} ]; then
47-
${pkgs.iproute2}/bin/ip link del name '${id}'
47+
${pkgs.iproute2}/bin/ip link delete '${id}'
4848
fi
4949
${pkgs.iproute2}/bin/ip link add link '${macvtap.link}' name '${id}' address '${mac}' type macvtap '${macvtap.mode}'
5050
${pkgs.iproute2}/bin/ip link set '${id}' allmulticast on
@@ -56,7 +56,7 @@ in
5656
macvtap-down = ''
5757
set -ou pipefail
5858
'' + lib.concatMapStrings ({ id, ... }: ''
59-
${pkgs.iproute2}/bin/ip link del name '${id}'
59+
${pkgs.iproute2}/bin/ip link delete '${id}'
6060
'') macvtapInterfaces;
6161
}
6262
) ];

0 commit comments

Comments
 (0)