sflowtool icon indicating copy to clipboard operation
sflowtool copied to clipboard

add option to listen on specified address

Open wydrych opened this issue 2 years ago • 0 comments

#44 reworked

verification

I expect no behavior change if sflowtool is run w/o -b. Output of netstat -npl | fgrep sflow is attached for verification.

listening on implicit any

sflowtool

udp6       0      0 :::6343                 :::*                                1682591/src/sflowto 

sflowtool -4

udp        0      0 0.0.0.0:6343            0.0.0.0:*                           1682657/src/sflowto 

sflowtool -6

udp6       0      0 :::6343                 :::*                                1682679/src/sflowto 

listening on explicit any

sflowtool -4 -b 0.0.0.0

udp        0      0 0.0.0.0:6343            0.0.0.0:*                           1682727/src/sflowto 

sflowtool -6 -b ::

udp6       0      0 :::6343                 :::*                                1682783/src/sflowto

listening on localhost

sflowtool -4 -b 127.0.0.1

udp        0      0 127.0.0.1:6343          0.0.0.0:*                           1682896/src/sflowto

sflowtool -6 -b ::1

udp6       0      0 ::1:6343                :::*                                1682933/src/sflowto

listening on arbitrary IP

sflowtool -4 -b 192.168.8.1

udp        0      0 192.168.8.1:6343        0.0.0.0:*                           1683018/src/sflowto

wrong AFI or malformed IP

$ src/sflowtool -4 -b 127.0.0.0.1
could not parse '127.0.0.0.1' as an IPv4 address
unable to open UDP read socket
$ src/sflowtool -6 -b 192.168.8.1
could not parse '192.168.8.1' as an IPv6 address
unable to open UDP read socket
$ src/sflowtool -6 -b bad
could not parse 'bad' as an IPv6 address
unable to open UDP read socket

wydrych avatar Nov 15 '23 12:11 wydrych