sflowtool
sflowtool copied to clipboard
add option to listen on loopback only
scope
Use -O to listen on loopback only – with keeping AFI selection by -4 / -6.
I guess it would be more valuable to add option to define listening address, but for my use-case listening on any vs loopback is enough and I see this patch as a good start.
verification
I expect no behavior change if sflowtool is run w/o -O. Output of netstat -anpl | fgrep sflow is attached for verification.
listening on any
sflowtool
udp6 0 0 :::6343 :::* 1629540/src/sflowto
sflowtool -4
udp 0 0 0.0.0.0:6343 0.0.0.0:* 1629694/src/sflowto
sflowtool -6
udp6 0 0 :::6343 :::* 1629769/src/sflowto
listening on loopback only
sflowtool -O
udp6 0 0 ::1:6343 :::* 1629842/src/sflowto
sflowtool -4 -O (or -4O)
udp 0 0 127.0.0.1:6343 0.0.0.0:* 1629864/src/sflowto
sflowtool -6 -O (or -6O)
udp6 0 0 ::1:6343 :::* 1629905/src/sflowto
I think specifying a bind address, or interface, might be the way to go.
I think specifying a bind address, or interface, might be the way to go.
The former hasn't taken too much time, see #45 :-) (And should you prefer #45, we can close #44 w/o merging.)