Skip to content

refactor pinger to use gvisor #42

@ainghazal

Description

@ainghazal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions