-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
netstat/Question[Bug?]: multicast group membership prints tcp/udp connections as well? (-g46) #33
Comments
Hm not sure if that was intentional, it does look a bit supprising. Since the man page lists it as a extra option and does not mention connections, we can probably change it (especially since there is no negative option to turn it off). |
hmm... or maybe it should filter only sockets listening on those groups... havent used much mcast tooling lately. |
I cant tell. My goal is to reimplement netstat in golang and found this weird behavior. |
I will change it. BTW if you reimplement something, I would not go with the /proc interface"ces but use (lib)netlink like |
Thanks for the advice. Yeah, the data from /proc is a nightmare to parse and process. So many different formats to read from..... Sadly I already have most functionality done and encountered this issue here, but I certainly will have a look. Maybe it allows more clean and structured code. Thank you. |
I checked again and I think the issue is coming from specifying -4 and -6 - those are not documented in the man-page as AF settings für -g: netstat {--groups|-g} [--numeric|-n] [--numeric-hosts] [--nu‐ So it basically uses -46 as an indicator to show IP sockets besides the group. If you only use "netstat -g" it works (limited support for address families). However it could be useful to limit to IPv4 or IPv6 address family? |
The patch here needs some more rework for man and translations, but it works now that you can filter like "netstat -g4" or "netstat -g -6" or "netstat -g46" which is the same as "netstat -g". There is also a buffer corruption with netstat "-g46c".
|
Is that behaviour deliberate or a bug?
The text was updated successfully, but these errors were encountered: