chiark / gitweb /
admin: Initialize reference counter for client blocks.
[tripe] / tun-bsd.c
index 5efe5ef8dc09cabe11730fe0e1a3e08cf9da0113..4e8c0bd82a6ba0d0a30fc5d3296f72aae7382e3c 100644 (file)
--- a/tun-bsd.c
+++ b/tun-bsd.c
@@ -76,12 +76,12 @@ static void t_read(int fd, unsigned mode, void *v)
 
   n = read(fd, buf_i, sizeof(buf_i));
   if (n < 0) {
-    a_warn("TUN %s read-error -- %s", t_ifname(t), strerror(errno));
+    a_warn("TUN", "%s", t_ifname(t), "read-error", "?ERRNO", A_END);
     return;
   }
   IF_TRACING(T_TUNNEL, {
-    trace(T_TUNNEL, "tunnel: packet arrived");
-    trace_block(T_PACKET, "tunnel: packet contents", buf_i, n);
+    trace(T_TUNNEL, "tun-bsd: packet arrived");
+    trace_block(T_PACKET, "tun-bsd: packet contents", buf_i, n);
   })
   buf_init(&b, buf_i, n);
   p_tun(t->p, &b);
@@ -125,10 +125,10 @@ static tunnel *t_create(peer *p)
        T( trace(T_TUNNEL, "tunnel device %u busy: skipping", n); )
        break;
       case ENOENT:
-       a_warn("TUN - bsd no-tunnel-devices");
+       a_warn("TUN", "-", "bsd", "no-tunnel-devices", A_END);
        return (0);
       default:
-       a_warn("TUN - open-error %s -- %s", buf, strerror(errno));
+       a_warn("TUN", "-", "open-error", "%s", buf, "?ERRNO", A_END);
        break;
     }
     n++;
@@ -141,7 +141,7 @@ static tunnel *t_create(peer *p)
   t->n = n;
   sel_initfile(&sel, &t->f, fd, SEL_READ, t_read, t);
   sel_addfile(&t->f);
-  T( trace(T_TUNNEL, "tunnel: attached interface %s to peer `%s'",
+  T( trace(T_TUNNEL, "tun-bsd: attached interface %s to peer `%s'",
           t_ifname(t), p_name(p)); )
   return (t);
 }
@@ -159,8 +159,8 @@ static tunnel *t_create(peer *p)
 static void t_inject(tunnel *t, buf *b)
 {
   IF_TRACING(T_TUNNEL, {
-    trace(T_TUNNEL, "tunnel: inject decrypted packet");
-    trace_block(T_PACKET, "tunnel: packet contents", BBASE(b), BLEN(b));
+    trace(T_TUNNEL, "tun-bsd: inject decrypted packet");
+    trace_block(T_PACKET, "tun-bsd: packet contents", BBASE(b), BLEN(b));
   })
   write(t->f.fd, BBASE(b), BLEN(b));
 }