mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-25 02:58:54 +00:00
socket: don't fail if DIAG_SHUTDOWN is absent
A error message is printed. We want to save ability to try crtools on non C/R kernel. Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
d08905bf89
commit
08ffa65ed5
2 changed files with 9 additions and 12 deletions
11
sk-inet.c
11
sk-inet.c
|
|
@ -345,11 +345,6 @@ int inet_collect_one(struct nlmsghdr *h, int family, int type, int proto)
|
|||
parse_rtattr(tb, INET_DIAG_MAX, (struct rtattr *)(m + 1),
|
||||
h->nlmsg_len - NLMSG_LENGTH(sizeof(*m)));
|
||||
|
||||
if (!tb[INET_DIAG_SHUTDOWN]) {
|
||||
pr_err("Can't check shutdown state of inet socket\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
d = xzalloc(sizeof(*d));
|
||||
if (!d)
|
||||
return -1;
|
||||
|
|
@ -363,7 +358,11 @@ int inet_collect_one(struct nlmsghdr *h, int family, int type, int proto)
|
|||
d->wqlen = m->idiag_wqueue;
|
||||
memcpy(d->src_addr, m->id.idiag_src, sizeof(u32) * 4);
|
||||
memcpy(d->dst_addr, m->id.idiag_dst, sizeof(u32) * 4);
|
||||
d->shutdown = *(u8 *)RTA_DATA(tb[INET_DIAG_SHUTDOWN]);
|
||||
|
||||
if (tb[INET_DIAG_SHUTDOWN])
|
||||
d->shutdown = *(u8 *)RTA_DATA(tb[INET_DIAG_SHUTDOWN]);
|
||||
else
|
||||
pr_err_once("Can't check shutdown state of inet socket\n");
|
||||
|
||||
ret = sk_collect_one(m->idiag_inode, family, &d->sd);
|
||||
|
||||
|
|
|
|||
10
sk-unix.c
10
sk-unix.c
|
|
@ -262,12 +262,10 @@ static int unix_collect_one(const struct unix_diag_msg *m,
|
|||
d->state = m->udiag_state;
|
||||
INIT_LIST_HEAD(&d->list);
|
||||
|
||||
if (!tb[UNIX_DIAG_SHUTDOWN]) {
|
||||
pr_err("No socket shutdown info\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
d->shutdown = *(u8 *)RTA_DATA(tb[UNIX_DIAG_SHUTDOWN]);
|
||||
if (tb[UNIX_DIAG_SHUTDOWN])
|
||||
d->shutdown = *(u8 *)RTA_DATA(tb[UNIX_DIAG_SHUTDOWN]);
|
||||
else
|
||||
pr_err_once("No socket shutdown info\n");
|
||||
|
||||
if (tb[UNIX_DIAG_PEER])
|
||||
d->peer_ino = *(int *)RTA_DATA(tb[UNIX_DIAG_PEER]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue