It is important to know why a syscall failed so pasta should include the
errno in the error message. This is still not perfect as we do not know
which of functions (open, ioctl, if_nametoindex) failed but it should at
least include more important context.
This change was inspiered by a podman issue[1].
[1] https://github.com/containers/podman/issues/19428
Signed-off-by: Paul Holzinger <pholzing(a)redhat.com>
---
tap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tap.c b/tap.c
index a6a73d3..c212616 100644
--- a/tap.c
+++ b/tap.c
@@ -1205,7 +1205,8 @@ static void tap_sock_tun_init(struct ctx *c)
NS_CALL(tap_ns_tun, c);
if (tun_ns_fd == -1)
- die("Failed to open tun socket in namespace");
+ die("Failed to open tun socket in namespace: %s",
+ strerror(errno));
pasta_ns_conf(c);
--
2.41.0