Block on sendmsg and revert 4a68866
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
2
mud
2
mud
Submodule mud updated: 6623be1e69...2c9d971437
@@ -249,18 +249,11 @@ gt_bind(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (FD_ISSET(mud_fd, &rfds)) {
|
if (FD_ISSET(mud_fd, &rfds)) {
|
||||||
int n = 1000;
|
|
||||||
|
|
||||||
while (n--) {
|
|
||||||
const int r = mud_recv(mud, buf, sizeof(buf));
|
const int r = mud_recv(mud, buf, sizeof(buf));
|
||||||
|
|
||||||
if (r <= 0)
|
if (r > 0 && ip_is_valid(buf, r))
|
||||||
break;
|
|
||||||
|
|
||||||
if (ip_is_valid(buf, r))
|
|
||||||
tun_write(tun_fd, buf, (size_t)r);
|
tun_write(tun_fd, buf, (size_t)r);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (FD_ISSET(ctl_fd, &rfds)) {
|
if (FD_ISSET(ctl_fd, &rfds)) {
|
||||||
struct ctl_msg req, res = {.reply = 1};
|
struct ctl_msg req, res = {.reply = 1};
|
||||||
|
|||||||
Reference in New Issue
Block a user