chiark / gitweb /
Allow admin clients to filter out async messages. Send notifications
[tripe] / tun-linux.c
index c30784d7cf91c76c61cabfd0c3e2b9904ce8b39c..6aa5adb4219da4426728aa5505e20a0944e24d5d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: tun-linux.c,v 1.3 2004/04/08 01:36:17 mdw Exp $
+ * $Id$
  *
  * Tunnel interface based on Linux TUN/TAP driver
  *
@@ -57,7 +57,7 @@ static void t_read(int fd, unsigned mode, void *v)
 
   n = read(fd, buf_i, sizeof(buf_i));
   if (n < 0) {
-    a_warn("tunnel read failed (%s): %s", t->ifn, strerror(errno));
+    a_warn("TUN %s read-error -- %s", t->ifn, strerror(errno));
     return;
   }
   IF_TRACING(T_TUNNEL, {
@@ -100,15 +100,14 @@ int tun_create(tunnel *t, peer *p)
   struct ifreq iff;
 
   if ((fd = open("/dev/net/tun", O_RDWR)) < 0) {
-    a_warn("open `/dev/net/tun' failed: %s", strerror(errno));
+    a_warn("TUN - open-error /dev/net/tun -- %s", strerror(errno));
     return (-1);
   }
   fdflags(fd, O_NONBLOCK, O_NONBLOCK, FD_CLOEXEC, FD_CLOEXEC);
   iff.ifr_name[0] = 0;
   iff.ifr_flags = IFF_TUN;
   if ((f = ioctl(fd, TUNSETIFF, &iff)) < 0) {
-    a_warn("couldn't set configure new TUN/TAP interface: %s",
-          strerror(errno));
+    a_warn("TUN - linux config-error -- %s", strerror(errno));
     close(fd);
     return (-1);
   }