Skip to content
Browse files

Report errno on TUNSETIFF failure.

  • Loading branch information...
1 parent 49500dc commit 33938a3b672dae113e820892ec739fc3d58005a8 @archaelus committed Mar 6, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 c_src/enet_tap.c
View
2 c_src/enet_tap.c
@@ -15,6 +15,7 @@
#include <linux/if_tun.h>
#include <string.h>
#include <sys/ioctl.h>
+#include <errno.h>
#endif
#define MAX_PACKET_SIZE 1500
@@ -219,6 +220,7 @@ int main(int argc, char **argv) {
ifr.ifr_name[IFNAMSIZ-1] = '\0';
if(ioctl(tap_fd, TUNSETIFF, (void *) &ifr) < 0 ){
+ printf("ioctl failed! Errno [%s]", strerror(errno));
err(11, "Couldn't create device %s.", optarg);
}
}

0 comments on commit 33938a3

Please sign in to comment.
Something went wrong with that request. Please try again.