Code cleanup

This commit is contained in:
Adrien Gallouët
2017-01-06 10:16:13 +00:00
parent 4988479df4
commit 09d1932588

View File

@@ -386,8 +386,7 @@ main(int argc, char **argv)
size_t size = 0;
while (sizeof(buf) - size >= gt.mtu) {
const int r = tun_read(tun_fd, &buf[size],
sizeof(buf) - size);
const int r = tun_read(tun_fd, &buf[size], sizeof(buf) - size);
if (r <= 0 || r > gt.mtu)
break;
@@ -422,7 +421,7 @@ main(int argc, char **argv)
tc = ic.tc & 0xFC;
}
if (p == q)
if (p >= q)
break;
int r = mud_send(mud, &buf[p], q - p, tc);