chiark
/
gitweb
/
~mdw
/
tripe
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More support scripts and other cool stuff.
[tripe]
/
tun-linux.c
diff --git
a/tun-linux.c
b/tun-linux.c
index 8c7278cebd947dcc21fd7e087e3032acf4317a52..bf44930049bd02ba583e0eb0ef396d63d4d71d4f 100644
(file)
--- 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, {
return;
}
IF_TRACING(T_TUNNEL, {
- trace(T_TUNNEL, "tun
nel
: packet arrived");
- trace_block(T_PACKET, "tun
nel
: 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);
})
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);
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) {
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);
sel_addfile(&t->f);
iff.ifr_name[IFNAMSIZ - 1] = 0;
strcpy(t->ifn, iff.ifr_name);
- T( trace(T_TUNNEL, "tun
nel
: 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);
}
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, {
static void t_inject(tunnel *t, buf *b)
{
IF_TRACING(T_TUNNEL, {
- trace(T_TUNNEL, "tun
nel
: 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));
trace_block(T_PACKET, "tunnel: packet contents", BBASE(b), BLEN(b));
})
write(t->f.fd, BBASE(b), BLEN(b));