Commit f79755e5 authored by Hirofumi Ogawa's avatar Hirofumi Ogawa Committed by David S. Miller

[AF_UNIX]: Print out paths correctly in /proc/net/unix, matching 2.4.x

parent 5d6d0cf4
...@@ -1863,14 +1863,19 @@ static int unix_seq_show(struct seq_file *seq, void *v) ...@@ -1863,14 +1863,19 @@ static int unix_seq_show(struct seq_file *seq, void *v)
sock_i_ino(s)); sock_i_ino(s));
if (u->addr) { if (u->addr) {
int i; int i, len;
seq_putc(seq, ' '); seq_putc(seq, ' ');
for (i = 0; i < u->addr->len-sizeof(short); i++) i = 0;
seq_putc(seq, u->addr->name->sun_path[i]); len = u->addr->len - sizeof(short);
if (!UNIX_ABSTRACT(s))
if (UNIX_ABSTRACT(s)) len--;
else {
seq_putc(seq, '@'); seq_putc(seq, '@');
i++;
}
for ( ; i < len; i++)
seq_putc(seq, u->addr->name->sun_path[i]);
} }
unix_state_runlock(s); unix_state_runlock(s);
seq_putc(seq, '\n'); seq_putc(seq, '\n');
......
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