-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
Support IPv6 #53
Comments
bandwhich/src/os/lsof_utils.rs Line 65 in 9d93d34
it says that use ip4 only |
bandwhich/src/network/sniffer.rs Line 6 in 9d93d34
bandwhich/src/network/connection.rs Line 3 in 9d93d34
May be related to #34 |
I can confirm that #34 is related. |
So, I'm afraid this tool is very much ipv4 centered at the moment on all platforms. It shouldn't be a problem to get it to also work with ipv6, but it will require some work. Off the top of my head:
Anyone wants to work on this? I'd be happy to provide pointers and guidance. |
I will take this.
Anything else needs to be done in order to support this feature? |
bandwhich/src/os/lsof_utils.rs Line 19 in da15644
Would you give an example of what this regex is supposed to match? I'm trying to adapt this regex for Ipv6 addresses. |
bandwhich/src/os/lsof_utils.rs Line 110 in da15644
It might not be a bad idea to replace that regex with hand-written parsing code, though. |
Hey @zhangxp1998 - @lnicola is right. It would definitely be great to get a more robust parser here if you feel up to it, but it might be out of scope for this feature (up to you). The points you wrote seem to be a good run down. I think the best thing to do would be to start out and see what's missing. Which brings me to another very important point: Tests. You could probably duplicate a lot of the ipv4 tests and just expect different results. Bandwhich uses snapshot testing using insta. Let me know if you need a hand with it. What we need to think about with ipv6 is the length of the addresses and consequently the screen real-estate we have to give them. As things are right now, connection strings get cut off quite often (especially since we added the interface name at the beginning). I want to address this issue, but it will be even harder with ipv6. Do try to give a thought to this when developing, and feel free to consult me and/or write more here so others could also participate in the discussion. Happy to hear you're taking this up! I saw you started out with a draft PR, ping me there too if you prefer talking about the implementation there. |
My thinking was that regular expressions are a bit overkill for this and they have their costs (performance, compile time, binary size). Sorry for randomly poking around issues like this. I'd love to contribute (and to see how it works), but I'm not sure when/if I'll find some time. One thing I'm curious about is whether BPF and possibly |
@lnicola - nothing to be sorry for. :) I think the discussion is valuable as long as it's on-topic. |
Great tool! Noticed ipv6 traffic is not being reported by the tool
Using the compiled binary release 0.6.0
Test/reproduce issue
wget -6 http://releases.ubuntu.com/18.04.3/ubuntu-18.04.3-desktop-amd64.iso
wget -4 http://releases.ubuntu.com/18.04.3/ubuntu-18.04.3-desktop-amd64.iso
The text was updated successfully, but these errors were encountered: