Commit 86489a54 authored by Pavel Emelyanov's avatar Pavel Emelyanov

sockets: Drop socket name for any bound-to-unlinked case

This maybe not 100% correct in the generic case, but the way unix sockets are
used lets us do this trick.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 8717463a
...@@ -539,7 +539,7 @@ static int unix_collect_one(const struct unix_diag_msg *m, ...@@ -539,7 +539,7 @@ static int unix_collect_one(const struct unix_diag_msg *m,
memcpy(name, RTA_DATA(tb[UNIX_DIAG_NAME]), len); memcpy(name, RTA_DATA(tb[UNIX_DIAG_NAME]), len);
name[len] = '\0'; name[len] = '\0';
if (name[0] != '\0' && d->state == TCP_LISTEN) { if (name[0] != '\0') {
struct unix_diag_vfs *uv; struct unix_diag_vfs *uv;
struct stat st; struct stat st;
...@@ -574,9 +574,9 @@ static int unix_collect_one(const struct unix_diag_msg *m, ...@@ -574,9 +574,9 @@ static int unix_collect_one(const struct unix_diag_msg *m,
(int)uv->udiag_vfs_dev, (int)uv->udiag_vfs_dev,
(int)uv->udiag_vfs_ino); (int)uv->udiag_vfs_ino);
/* /*
* When a listen socket is bound to * When a socket is bound to unlinked file, we
* unlinked file, we just drop his name, * just drop his name, since noone will access
* since noone will access it via one. * it via one.
*/ */
xfree(name); xfree(name);
len = 0; len = 0;
......
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