Update mud and path_status
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
2
mud
2
mud
Submodule mud updated: cd4ad61d1c...bb6b87bb54
@@ -257,10 +257,10 @@ gt_bind(int argc, char **argv)
|
|||||||
res.ret = EAGAIN;
|
res.ret = EAGAIN;
|
||||||
|
|
||||||
for (unsigned i = 0; i < count; i++) {
|
for (unsigned i = 0; i < count; i++) {
|
||||||
if (i && sendto(ctl_fd, &res, sizeof(res), 0,
|
|
||||||
(const struct sockaddr *)&ss, sl) == -1)
|
|
||||||
perror("sendto(ctl)");
|
|
||||||
memcpy(&res.path_status, &paths[i], sizeof(struct mud_path));
|
memcpy(&res.path_status, &paths[i], sizeof(struct mud_path));
|
||||||
|
if (sendto(ctl_fd, &res, sizeof(res), 0,
|
||||||
|
(const struct sockaddr *)&ss, sl) == -1)
|
||||||
|
perror("sendto(ctl)");
|
||||||
}
|
}
|
||||||
|
|
||||||
res.ret = 0;
|
res.ret = 0;
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ gt_path_status(int fd)
|
|||||||
if (recv(fd, &res, sizeof(struct ctl_msg), 0) == -1)
|
if (recv(fd, &res, sizeof(struct ctl_msg), 0) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (res.type != req.type)
|
||||||
|
return -2;
|
||||||
|
|
||||||
|
if (!res.ret)
|
||||||
|
return 0;
|
||||||
|
|
||||||
char bindstr[INET6_ADDRSTRLEN] = {0};
|
char bindstr[INET6_ADDRSTRLEN] = {0};
|
||||||
char peerstr[INET6_ADDRSTRLEN] = {0};
|
char peerstr[INET6_ADDRSTRLEN] = {0};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user