chiark / gitweb /
Allow admin clients to filter out async messages. Send notifications
[tripe] / tun-bsd.c
index 39e3e108381a4856a8b2a49a16173ad455ba1aad..620ea987e72b764ef19f4cde933420d4d66f4406 100644 (file)
--- a/tun-bsd.c
+++ b/tun-bsd.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: tun-bsd.c,v 1.1 2001/02/05 19:48:18 mdw Exp $
+ * $Id$
  *
  * Tunnel interface for 4.4BSD-derived systems
  *
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-/*----- Revision history --------------------------------------------------* 
- *
- * $Log: tun-bsd.c,v $
- * Revision 1.1  2001/02/05 19:48:18  mdw
- * Initial support for BSD tunnel devices.
- *
- */
-
 /*----- Header files ------------------------------------------------------*/
 
 #include "tripe.h"
@@ -63,7 +55,7 @@ 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", tun_ifname(t), strerror(errno));
+    a_warn("TUN %s read-error -- %s", tun_ifname(t), strerror(errno));
     return;
   }
   IF_TRACING(T_TUNNEL, {
@@ -108,17 +100,17 @@ int tun_create(tunnel *t, peer *p)
   n = 0;
   for (;;) {
     sprintf(buf, "/dev/tun%u", n);
-    if ((fd = open("/dev/unet", O_RDWR)) >= 0)
+    if ((fd = open(buf, O_RDWR)) >= 0)
       break;
     switch (errno) {
       case EBUSY:
        T( trace(T_TUNNEL, "tunnel device %u busy: skipping", n); )
        break;
       case ENOENT:
-       a_warn("no suitable tunnel devices found");
+       a_warn("TUN - bsd no-tunnel-devices");
        return (-1);
       default:
-       a_warn("error opening `%s': %s (skipping)", buf, strerror(errno));
+       a_warn("TUN - open-error %s -- %s", buf, strerror(errno));
        break;
     }
     n++;