Commit 08ffa65e authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

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: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent d08905bf
......@@ -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);
......
......@@ -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]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment