X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/de014da64011b21929158b746803d69cbfb05ee6..060ca767db058036f7ade27219de9ebaf1d4737b:/tun-linux.c diff --git a/tun-linux.c b/tun-linux.c index 8c7278ce..bf449300 100644 --- a/tun-linux.c +++ b/tun-linux.c @@ -72,8 +72,8 @@ static void t_read(int fd, unsigned mode, void *v) 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-linux: packet arrived"); + trace_block(T_PACKET, "tun-linux: packet contents", buf_i, n); }) buf_init(&b, buf_i, n); p_tun(t->p, &b); @@ -112,6 +112,7 @@ static tunnel *t_create(peer *p) return (0); } fdflags(fd, O_NONBLOCK, O_NONBLOCK, FD_CLOEXEC, FD_CLOEXEC); + memset(&iff, 0, sizeof(iff)); iff.ifr_name[0] = 0; iff.ifr_flags = IFF_TUN | IFF_NO_PI; if ((f = ioctl(fd, TUNSETIFF, &iff)) < 0) { @@ -126,7 +127,7 @@ static tunnel *t_create(peer *p) sel_addfile(&t->f); iff.ifr_name[IFNAMSIZ - 1] = 0; strcpy(t->ifn, iff.ifr_name); - T( trace(T_TUNNEL, "tunnel: attached interface %s to peer `%s'", + T( trace(T_TUNNEL, "tun-linux: attached interface %s to peer `%s'", t->ifn, p_name(p)); ) return (t); } @@ -153,7 +154,7 @@ static const char *t_ifname(tunnel *t) { return (t->ifn); } static void t_inject(tunnel *t, buf *b) { IF_TRACING(T_TUNNEL, { - trace(T_TUNNEL, "tunnel: inject decrypted packet"); + trace(T_TUNNEL, "tun-linux: inject decrypted packet"); trace_block(T_PACKET, "tunnel: packet contents", BBASE(b), BLEN(b)); }) write(t->f.fd, BBASE(b), BLEN(b));