From b4a4a28634edfefe5c7c2728662d5fdca3462c7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Mon, 30 Nov 2020 11:37:34 +0100 Subject: [PATCH] Use ip link show to detect bridge ip tuntap show lists all tuntap devices and ignores the rest of the arguments, annoyingly. It will always return with exit code 0. We do not detect if the interface is a bridge. --- src/vmm_unix.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmm_unix.ml b/src/vmm_unix.ml index 3033b1f..38347ed 100644 --- a/src/vmm_unix.ml +++ b/src/vmm_unix.ml @@ -233,7 +233,7 @@ let bridge_exists bridge_name = let cmd = match Lazy.force uname with | FreeBSD -> Bos.Cmd.(v "ifconfig" % bridge_name) - | Linux -> Bos.Cmd.(v "ip" % "tuntap" % "show" % bridge_name) + | Linux -> Bos.Cmd.(v "ip" % "link" % "show" % bridge_name) in Bos.OS.Cmd.(run_out ~err:err_null cmd |> out_null |> success)