Compare commits

..

2 Commits

Author SHA1 Message Date
angt
babe14d544 Quit on tun error 2016-04-25 10:24:42 +00:00
angt
278fc69789 Update mud 2016-04-21 15:35:35 +00:00
2 changed files with 12 additions and 5 deletions

2
mud

Submodule mud updated: 3b86683636...04c8495fe6

View File

@@ -387,8 +387,10 @@ int main (int argc, char **argv)
while (1) {
const ssize_t r = tun_read(tun_fd, buf, sizeof(buf));
if (r<=0)
if (r<=0) {
gt.quit |= !r;
break;
}
struct ip_common ic;
@@ -403,12 +405,17 @@ int main (int argc, char **argv)
mud_pull(mud);
while (1) {
const int r = mud_recv(mud, buf, sizeof(buf));
const int size = mud_recv(mud, buf, sizeof(buf));
if (r<=0)
if (size<=0)
break;
tun_write(tun_fd, buf, r);
const ssize_t r = tun_write(tun_fd, buf, size);
if (r<=0) {
gt.quit |= !r;
break;
}
}
}