* use safe xstrncpy() rather than strcpy()
* use sizeof() for static buffers rather than macro with real size
(this solution is more robust for future code changes)
* use xcalloc() to zeroize allocated memory
Signed-off-by: Karel Zak <kzak@redhat.com>
The format of /proc/net/udp was changed in
6c25449e1a32 ("net: udp: fix alignment problem in udp4_seq_show()").
This kind of change can be applied to /proc/net/tcp, too.
Co-Authored-by: Thomas Weißschuh <thomas@t-8ch.de>
Co-Authored-by: Masatake YAMATO <yamato@redhat.com>
isc-utils/lsfd-sock-xinfo.c:588:34: error: extra ';' outside of a function [-Werror,-Wextra-semi]
define_fill_column_func(tcp, TCP);
^
misc-utils/lsfd-sock-xinfo.c:703:34: error: extra ';' outside of a function [-Werror,-Wextra-semi]
define_fill_column_func(udp, UDP);
^
Addresses: 92a0dbce7c
Signed-off-by: Karel Zak <kzak@redhat.com>
The loaded information is displayed at SOCKNETNS, SOCKSTATE,
SOCKTYPE, and/or UNIX.PATH columns of UNIX-STREAM and UNIX
typed sockets.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Files under /proc/net/ like unix, tcp, udp, etc. provides extra
information about sockets. To unitize these information in
lsfd, this change adds stub for loading the information form
/proc/net/* and attaching it to struct file presenting sockets.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>