Subject: netstat and unix domain socket
To: None <current-users@NetBSD.ORG>
From: enami tsugutomo <firstname.lastname@example.org>
Date: 11/17/1996 23:37:08
I recently noticed that current netstat sometimes prints junk after
unix domain socket name. For example, here is output from netstat |
cat -v on my NetBSD/i386 box.
f876e700 dgram 0 0 f8771200 0 f87b0080 0 /dev/logM--M-^
The direct reason of this seems to that the netstat is changed to
strict the size of unix domain socket name to sizeof (struct
sockaddr_un) rather than the length of mbuf - some constat during
NetBSD 1.2 and current NetBSD.
It seems to expect the copy of bind args in kernel to be terminated by
NUL, but actually it doesn't include it unless user doen't include NUL
to the third arg of bind.
Then, what it the right solution?
(1) Put netstat changes back so that it use mbuf length (or sun_len?),
(2) make sure the kernel to copy terminating NUL when coping bind arg,
or (3) make userland program to pass length including NUL as bind