From 3227ed232b1525bcbda11f7bb7d52c6bd98c2c67 Mon Sep 17 00:00:00 2001 From: Tristan Brice Velloza Kildaire Date: Sun, 15 Dec 2024 18:19:59 +0200 Subject: [PATCH] TAP - Added another check --- TAP.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/TAP.c b/TAP.c index 935bbbb..6dbd37b 100644 --- a/TAP.c +++ b/TAP.c @@ -244,6 +244,13 @@ int open_tap(void) { { // Firstly, obtain the interface index by `ifr_name` int inet6 = socket(AF_INET6, SOCK_DGRAM, 0); + if(inet6 < 0) + { + printf("Error opening control socket for adding IPv6 address to interface\n"); + cleanup(); + exit(1); + } + if(ioctl(inet6, SIOCGIFINDEX, &ifr) < 0) { printf("Could not get interface index for interface '%s'\n", ifr.ifr_name);