about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/network/if_nametoindex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/if_nametoindex.c b/src/network/if_nametoindex.c
index fb4a1474..cb6ec054 100644
--- a/src/network/if_nametoindex.c
+++ b/src/network/if_nametoindex.c
@@ -14,5 +14,5 @@ unsigned if_nametoindex(const char *name)
 	strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name);
 	r = ioctl(fd, SIOCGIFINDEX, &ifr);
 	__syscall(SYS_close, fd);
-	return r < 0 ? r : ifr.ifr_ifindex;
+	return r < 0 ? 0 : ifr.ifr_ifindex;
 }