On Sun, Aug 26, 2018 at 01:19:05PM +0100, [email protected] wrote: > Hi, > > I'm looking for a way to see which processes are listening > on incoming tcp/udp connections. > > So, here is my output of netstat -f inet -p udp -l > > Proto Recv-Q Send-Q Local Address Foreign Address (state) > udp 0 0 core.5022 lithium.constant.ntp > udp 0 0 core.8806 hydrogen.constan.ntp > udp 0 0 core.21164 helium.constant..ntp > udp 0 0 *.* *.* > udp 0 0 *.* *.* > > First, what does it mean *.* *.* in last 2 entries.
Those sockets are not bound or connected. This is possible with UDP sockets since you can use for example sendto(2) without doing a bind(2) or connect(2) call beforehands. There are some daemons that do this (dhclient, slaacd). > Second, how can I verify what process is listening on ports > 5022,8806 and 21164? > This is not possible since more than one process can be listening on a socket (since file descriptors can be shared). You need to use fstat(1) for this. What linux offers is at best best-effort and sometimes wrong. -- :wq Claudio

