Skip to content
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

refactor pinger to use gvisor #42

Open
ainghazal opened this issue Apr 14, 2023 · 0 comments
Open

refactor pinger to use gvisor #42

ainghazal opened this issue Apr 14, 2023 · 0 comments

Comments

@ainghazal
Copy link
Collaborator

ainghazal commented Apr 14, 2023

During discussion of #35 we considered the constrains that led to having two different parsing implementations. The gist of it was:

switch p.Raw {
case false:
	pkt = p.parseEchoReplyFromICMP(recv.bytes, from)
case true:
	pkt = p.parseEchoReplyFromIP(recv.bytes)
}

The reason is that in minivpn's client we're writing raw IP packets, while in the case of wireguard we're using a ICMP Dialer that does not allow us to parse the IP packet. We decided to unify the design and let gvisor handle the icmp packets in both cases, but to merge this PR and defer the refactor.

With @bassosimone we also decided to make the needed modifications to intercept the incoming packets in gvisor's netstack, so that we can track the TTL value for the incoming replies (as that seems to be the main advantage of parsing the IP packets in the case of the pinger usage for minivpn).

See also #40, since this refactor can probably be made while splitting the package into its own repo & reusable module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant