Commit Graph

1612 Commits

Author SHA1 Message Date
Thomas Eizinger
2ad65982f0 refactor(connlib): hardcode size of EncryptBuffer (#7042)
This buffer is effectively limited by the maximum size of our IP packets
(which is guided by our interface MTU). Passing a length is
unnecessarily abstract.

For implementing DNS over TCP, we will need to encapsulate packets that
are emitted by the `dns_over_tcp::Client` which requires creating such a
buffer on the fly.

In the future, we should probably consider also stack-allocating all our
`Transmit`s so we can get rid of passing around this buffer altogether.
2024-10-16 03:04:49 +00:00
Thomas Eizinger
d8cc4c7161 chore(rust): use latest main of smoltcp (#7062)
The last released version of `smoltcp` is `0.11.0`. That version is
almost a year old. Since then, an important "bug" got fixed in the IPv6
handling code of `smoltcp`.

In order to route packets to our interface, we define a dummy IPv4 and
IPv6 address and create catch-all routes with our interface as the
gateway. Together with `set_any_ip(true)`, the makes `smoltcp` accept
any packet we pass it to. This is necessary because we don't directly
connect `smoltcp` to the TUN device but rather have an `InMemoryDevice`
where we explicitly feed certain packets to it.

In the last released version, `smoltcp` only performs the above logic
for IPv4. For IPv6, the additional check for "do we have a route that
this packet matches" doesn't exist and thus no IPv6 traffic is accepted
by `smoltcp`.

Extracted out of #6944.
2024-10-16 02:15:26 +00:00
Thomas Eizinger
c21bd18b62 refactor(connlib): explicitely define UDP DNS server resources (#7043)
Currently, in our tests, traffic that is targeted at a resource is
handled "in-line" on the gateway. This doesn't really represent how the
real world works. In the real world, the gateway uses the IP forwarding
functionality of the Linux kernel and the corresponding NAT to send the
IP packet to the actual resource.

We don't want to implement this forwarding and NAT in the tests.
However, our testing harness is about to get more sophisticated. We will
be sending TCP DNS queries with #6944 and we want to test TCP and its
traffic filters with #7003.

The state of those TCP sockets needs to live _somewhere_.

If we "correctly" model this and introduce some kind of `HashMap` with
`dyn Resource` in `TunnelTest`, then we will have to actually implement
NAT for those packets to ensure that e.g. the SYN-ACK of a TCP handshake
makes it back to the correct(!) gateway.

That is rather cumbersome.

This PR suggests taking a shortcut there by associating the resources
with each gateway individually. At present, all we have are UDP DNS
servers. Those don't actually have any connection state themselves but
putting them in place gives us a framework for where we can put
connection-specific state. Most importantly, these resources MUST NOT
hold application-specific state. Instead, that state needs to be kept in
`ReferenceState` or `TunnelState` and passed in by reference, as we do
here for the DNS records.

This has effectively the same behaviour as correctly translating IP
packets back and forth between resources and gateways. The packets
"emitted" by a particular `UdpDnsServerResource` will always go back to
the correct gateway.
2024-10-16 01:10:38 +00:00
Thomas Eizinger
668aa1c40c fix(connlib): workaround smoltcp's time impurity (#7041)
The `smoltcp` crate has its own time-related types like `Instant` which
are backed by a simple microsecond-based integer. It has an integration
with `std::time::Instant` which we are currently using. That integration
however is impure because it relies on `Instant::now`.

To work around this, we initialise `smoltcp` with `Instant::ZERO` and
keep our own `std::time::Instant` around. Using that, we always compute,
how much time has elapsed since we initialised `smoltcp` and pass the
correct `Instant` to it.

Whilst learning about this, I also discovered that `smoltcp` has the
equivalent of `poll_timeout` so I went ahead and implemented that too.
2024-10-16 00:12:49 +00:00
Gabi
eedee56be2 chore(connlib): use proxy ip to match filters instead of translated (#6960)
Previously, when a gateway checked if a packet was allowed through, it
used the real IP of the DNS resource that the client was trying to
communicate with.

The problem with this was that if there's an overlapping CIDR resource
with the real IP this would allow a user to send packets using the
filters for that resource instead of the DNS resource filters.

This can be confusing for users as packet can flow unexpectedly to the
resources even if the filter doesn't permit it, so we use the IP of the
packet before we translate it to the real IP to match the filters.

This doesn't change the security of this feature as a user can just
change the IP of the packet with the dst of the DNS or the cidr resource
according to what they need.

Fixes #6806
2024-10-15 23:21:36 +00:00
Reactor Scram
8814dc8cdc chore(rust): specify exact version of tracing (#7037)
Because of the patch we apply, if we delete `Cargo.lock`, this line
causes an error. Deleting `Cargo.lock` should be valid in general.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-10-15 22:06:57 +00:00
Thomas Eizinger
40760869f7 refactor(connlib): lazily connect to upstream TCP DNS resolver (#7044)
In order to forward TCP DNS queries to custom resolvers that are also
resources, `connlib` needs to establish its own TCP connection to that
upstream server.

In the current design of `dns_over_tcp::Client`, this connection gets
established immediately as soon as we learn about, which upstream
resolvers we need to use. This is problematic because the resolver might
not **yet** be a resource. Resources can change at any point so until
they are a resource, we don't actually need to establish a TCP
connection. In fact, even if we wanted to, we couldn't because we can't
map the resolvers IP to a `ResourceId`. TCP is a reliable transport so
it will keep retrying to establish a connection until it eventually
gives up.

Not only is this wasteful but it also causes problems in our tests where
we have model, how and when connections are established. Having a TCP
stack within `connlib` that will retry to establish this connection
messes up that model.

To fix this, we change `connect_to_resolvers` to `set_resolvers`. This
will still create the sockets and allocate the ports but leaves the
socket in `Closed` state. We only issue a `connect` once we receive a
query that we need to send to that resolver.
2024-10-15 21:31:40 +00:00
Reactor Scram
bfb3250ae2 chore(ci/rust): build and test more packages in Windows (#7036)
Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-10-15 21:22:27 +00:00
Reactor Scram
32afc945fd fix(phoenix-channel/test/windows): account for 15 ms timing granularity (#7061)
Closes #6953 

- Increases heartbeat in unit test from 5 ms to 30 ms to avoid timer
aliasing on Windows
- Increases interval proportionally to 180 ms
- Corrects measurement of elapsed time for
`returns_heartbeat_after_interval`. The first `heartbeat.poll` seems to
consume a few ms, which can cause a false test failure
2024-10-15 21:05:33 +00:00
dependabot[bot]
69c3009949 build(deps-dev): Bump typescript from 5.6.2 to 5.6.3 in /rust/gui-client (#7051)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.6.2
to 5.6.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/microsoft/TypeScript/releases">typescript's
releases</a>.</em></p>
<blockquote>
<h2>TypeScript 5.6.3</h2>
<p>For release notes, check out the <a
href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/">release
announcement</a>.</p>
<p>For the complete list of fixed issues, check out the</p>
<ul>
<li><a
href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.6.0%22+is%3Aclosed+">fixed
issues query for Typescript 5.6.0 (Beta)</a>.</li>
<li><a
href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.6.1%22+is%3Aclosed+">fixed
issues query for Typescript 5.6.1 (RC)</a>.</li>
<li><a
href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.6.2%22+is%3Aclosed+">fixed
issues query for Typescript 5.6.2 (Stable)</a>.</li>
<li><a
href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.6.3%22+is%3Aclosed+">fixed
issues query for Typescript 5.6.3 (Stable)</a>.</li>
</ul>
<p>Downloads are available on:</p>
<ul>
<li><a href="https://www.npmjs.com/package/typescript">npm</a></li>
<li><a
href="https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild">NuGet
package</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d48a5cf89a"><code>d48a5cf</code></a>
Bump version to 5.6.3 and LKG</li>
<li><a
href="fefa70aa18"><code>fefa70a</code></a>
🤖 Pick PR <a
href="https://redirect.github.com/microsoft/TypeScript/issues/60083">#60083</a>
(Don't issue implicit any when obtai...) into release-5.6 (#...</li>
<li><a
href="ff71692149"><code>ff71692</code></a>
[release-5.6] Remove tsbuildInfo specification error now that we need it
for ...</li>
<li><a
href="1f44dcf4e1"><code>1f44dcf</code></a>
🤖 Pick PR <a
href="https://redirect.github.com/microsoft/TypeScript/issues/60157">#60157</a>
(fix automatic type acquisition) into release-5.6 (<a
href="https://redirect.github.com/microsoft/TypeScript/issues/60169">#60169</a>)</li>
<li>See full diff in <a
href="https://github.com/microsoft/TypeScript/compare/v5.6.2...v5.6.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=typescript&package-manager=npm_and_yarn&previous-version=5.6.2&new-version=5.6.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 16:46:56 +00:00
dependabot[bot]
d17a78f4c2 build(deps-dev): Bump @types/node from 22.7.4 to 22.7.5 in /rust/gui-client (#7055)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.7.4 to 22.7.5.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.7.4&new-version=22.7.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 16:13:51 +00:00
dependabot[bot]
45acfce08c build(deps): Bump tempfile from 3.12.0 to 3.13.0 in /rust (#7054)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.12.0 to
3.13.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md">tempfile's
changelog</a>.</em></p>
<blockquote>
<h2>3.13.0</h2>
<ul>
<li>Add <code>with_suffix</code> constructors for easily creating new
temporary files with a specific suffix (e.g., a specific file
extension). Thanks to <a
href="https://github.com/Borgerr"><code>@​Borgerr</code></a>.</li>
<li>Update dependencies (fastrand &amp; rustix).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a354f8cb11"><code>a354f8c</code></a>
chore: release 3.13.0</li>
<li><a
href="d21b602fa2"><code>d21b602</code></a>
chore: update deps</li>
<li><a
href="d6600da8fc"><code>d6600da</code></a>
Add for <code>with_suffix</code> (<a
href="https://redirect.github.com/Stebalien/tempfile/issues/299">#299</a>)</li>
<li><a
href="19280c5889"><code>19280c5</code></a>
Document current default permissions for tempdirs (<a
href="https://redirect.github.com/Stebalien/tempfile/issues/296">#296</a>)</li>
<li><a
href="c5eac9f690"><code>c5eac9f</code></a>
fix: address clippy unnecessary deref lint in test (<a
href="https://redirect.github.com/Stebalien/tempfile/issues/294">#294</a>)</li>
<li>See full diff in <a
href="https://github.com/Stebalien/tempfile/compare/v3.12.0...v3.13.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tempfile&package-manager=cargo&previous-version=3.12.0&new-version=3.13.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 16:11:28 +00:00
dependabot[bot]
c0955811f1 build(deps): Bump lru from 0.12.4 to 0.12.5 in /rust (#7029)
Bumps [lru](https://github.com/jeromefroe/lru-rs) from 0.12.4 to 0.12.5.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/jeromefroe/lru-rs/blob/master/CHANGELOG.md">lru's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/jeromefroe/lru-rs/tree/0.12.5">v0.12.5</a> -
2024-10-30</h2>
<ul>
<li>Upgrade hashbrown dependency to 0.15.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="2d18d2d333"><code>2d18d2d</code></a>
Merge pull request <a
href="https://redirect.github.com/jeromefroe/lru-rs/issues/203">#203</a>
from jeromefroe/jerome/prepare-0-12-5-release</li>
<li><a
href="b42486918b"><code>b424869</code></a>
Prepare 0.12.5 release</li>
<li><a
href="1ba5130174"><code>1ba5130</code></a>
Merge pull request <a
href="https://redirect.github.com/jeromefroe/lru-rs/issues/202">#202</a>
from torokati44/hashbrown-0.15</li>
<li><a
href="60a7e71c59"><code>60a7e71</code></a>
Use top-level DefaultHashBuilder type alias</li>
<li><a
href="12ed995b7b"><code>12ed995</code></a>
Update hashbrown to 0.15</li>
<li>See full diff in <a
href="https://github.com/jeromefroe/lru-rs/compare/0.12.4...0.12.5">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=lru&package-manager=cargo&previous-version=0.12.4&new-version=0.12.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 16:07:24 +00:00
dependabot[bot]
b4cef7fe75 build(deps-dev): Bump tailwindcss from 3.4.13 to 3.4.14 in /rust/gui-client (#7052)
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from
3.4.13 to 3.4.14.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tailwindlabs/tailwindcss/releases">tailwindcss's
releases</a>.</em></p>
<blockquote>
<h2>v3.4.14</h2>
<h3>Fixed</h3>
<ul>
<li>Don't set <code>display: none</code> on elements that use
<code>hidden=&quot;until-found&quot;</code> (<a
href="https://redirect.github.com/tailwindlabs/tailwindcss/pull/14625">#14625</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/tailwindlabs/tailwindcss/blob/v3.4.14/CHANGELOG.md">tailwindcss's
changelog</a>.</em></p>
<blockquote>
<h2>[3.4.14] - 2024-10-15</h2>
<h3>Fixed</h3>
<ul>
<li>Don't set <code>display: none</code> on elements that use
<code>hidden=&quot;until-found&quot;</code> (<a
href="https://redirect.github.com/tailwindlabs/tailwindcss/pull/14625">#14625</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c616fb9562"><code>c616fb9</code></a>
3.4.14</li>
<li><a
href="b570e2b887"><code>b570e2b</code></a>
Don't set <code>display: none</code> on elements that use
<code>hidden=&quot;until-found&quot;</code> (<a
href="https://redirect.github.com/tailwindlabs/tailwindcss/issues/14625">#14625</a>)</li>
<li>See full diff in <a
href="https://github.com/tailwindlabs/tailwindcss/compare/v3.4.13...v3.4.14">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tailwindcss&package-manager=npm_and_yarn&previous-version=3.4.13&new-version=3.4.14)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 16:05:35 +00:00
Reactor Scram
786fbc6689 chore(gui-client): delete GTK+ and Iced prototypes (#7035)
We don't need these since Tauri v2 looks like it's about to succeed, and
keeping packages outside of the workspace has been breaking dependabot
PRs
2024-10-15 15:29:11 +00:00
Thomas Eizinger
dbe618c080 refactor(connlib): expose &mut TRoleState for direct access (#7026)
Currently, we have a lot of stupid code to forward data from the
`{Client,Gateway}Tunnel` interface to `{Client,Gateway}State`. Recent
refactorings such as #6919 made it possible to get rid of this
forwarding layer by directly exposing `&mut TRoleState`.

To maintain some type-privacy, several functions are made generic to
accept `impl Into` or `impl TryInto`.
2024-10-15 01:05:35 +00:00
Thomas Eizinger
b1e631dd00 fix(connlib): always use ephemeral ports for TCP connections (#7025)
The ports < 1024 are reserved and should not be used for outbound TCP
connections. Generally, a port from the ephemeral port range should be
used for that.

To enforce this, we move the port range of the `dns_over_tcp::Client` to
const-generics. At present, `connlib` only uses a single port range so
we set those as the default too.
2024-10-15 00:55:01 +00:00
Thomas Eizinger
6e0194f786 refactor(connlib): mangle UDP DNS query via tunnel earlier (#7023)
UDP DNS queries for upstream resolvers that happen to be resources need
to be sent through the tunnel. For that to work correctly, `connlib`
needs to rewrite the IP header such that the destination IP points to
the actual address of the DNS server.

Currently, this happens rather "late" in the processing of the packets,
i.e. after `try_handle_dns` has returned (where that decision is
actually made). This is rather confusing and also forces us to re-parse
the packet as a DNS packet at a later stage.

To avoid this, we move main functionality of
`maybe_mangle_dns_query_to_cidr_resource` into the branch where
`connlib`'s stub DNS resolver tells us that the query needs to be
forwarded via the tunnel.

With the upcoming support of TCP DNS queries, we will have a 2nd source
of IP packets that need to go through the tunnel: Packets emitted from
our internal TCP stack. Attempting to perform the same post-processing
on these TCP packets as we do with UDP is rather confusing, which is why
we want to remove this step from the `encapsulate` function.

Resolves: #5391.
2024-10-15 00:51:57 +00:00
Thomas Eizinger
8163c8567c refactor(connlib): clarify TUN and network input functions (#7022)
Within `connlib`, the `encapsulate` and `decapsulate` functions on
`ClientState` and `GatewayState` are the entrypoint for sending and
receiving network traffic. For example, IP packets read from the TUN
device are processed using these functions.

Not all packets / traffic passed to these functions is meant to be
encrypted. Some of it is TURN traffic with relays, some of it is DNS
traffic that we intercept.

To clarify this, we rename these functions to `handle_tun_input` and
`handle_network_input`.

As part of this clarification, we also call `handle_timeout` in case we
don't emit a decrypted IP packet when handling network input. Once we
support DNS over TCP (#6944), some IP packets sent through the tunnel
will originate from DNS servers that we forwarded queries to. In that
case, those responses will be handled by `connlib`'s internal TCP stack
and thus not produce a decrypted IP packet. To correctly, advance the
state in this case, we mirror what we already do for `handle_tun_input`
and call `handle_timeout` if `handle_network_input` yields `None`.
2024-10-15 00:19:19 +00:00
dependabot[bot]
28c8b676fb build(deps): Bump axum from 0.7.6 to 0.7.7 in /rust (#6871)
Bumps [axum](https://github.com/tokio-rs/axum) from 0.7.6 to 0.7.7.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/axum/releases">axum's
releases</a>.</em></p>
<blockquote>
<h2>axum-extra - v0.7.7</h2>
<ul>
<li><strong>added:</strong> <code>Clone</code> implementation for
<code>ErasedJson</code> (<a
href="https://redirect.github.com/tokio-rs/axum/issues/2142">#2142</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/axum/issues/2142">#2142</a>:
<a
href="https://redirect.github.com/tokio-rs/axum/pull/2142">tokio-rs/axum#2142</a></p>
<h2>axum v0.7.7</h2>
<ul>
<li><strong>change</strong>: Remove manual tables of content from the
documentation, since
rustdoc now generates tables of content in the sidebar (<a
href="https://redirect.github.com/tokio-rs/axum/issues/2921">#2921</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/axum/issues/2921">#2921</a>:
<a
href="https://redirect.github.com/tokio-rs/axum/pull/2921">tokio-rs/axum#2921</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="fe56a310ef"><code>fe56a31</code></a>
Bump versions</li>
<li><a
href="ac50d7daaf"><code>ac50d7d</code></a>
docs: Remove manual tables of content (<a
href="https://redirect.github.com/tokio-rs/axum/issues/2921">#2921</a>)</li>
<li><a
href="6f5607785d"><code>6f56077</code></a>
core: Fix compile errors from __log_rejection (<a
href="https://redirect.github.com/tokio-rs/axum/issues/2933">#2933</a>)</li>
<li><a
href="4fc0641874"><code>4fc0641</code></a>
Upgrade private dependencies (<a
href="https://redirect.github.com/tokio-rs/axum/issues/2935">#2935</a>)</li>
<li><a
href="6ec3a51f2d"><code>6ec3a51</code></a>
Clarify some subtleties of routing (<a
href="https://redirect.github.com/tokio-rs/axum/issues/2896">#2896</a>)</li>
<li>See full diff in <a
href="https://github.com/tokio-rs/axum/compare/axum-v0.7.6...axum-v0.7.7">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=axum&package-manager=cargo&previous-version=0.7.6&new-version=0.7.7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 00:15:51 +00:00
Thomas Eizinger
aee5019329 ci: enable unstable tokio logging for tests (#7038)
Hopefully helps in debugging #6953.
2024-10-14 22:45:03 +00:00
Thomas Eizinger
539b1c4f00 chore(connlib): don't respond on UDP DNS timeouts (#7020)
When handling DNS queries, `connlib` tries to be as transparent as
possible. For this reason, we byte-for-byte forward the DNS response
from the upstream resolver to the original source socket. In #6999, we
started modelling these DNS queries as explicit tasks in preparation for
DNS over TCP and DNS over HTTPS.

As part of that, we create a DNS response for _every_ IO error we
encounter as part of the recursive query. This includes timeouts, i.e.
when we don't receive a response at all. That actually breaks the rule
of "be a transparent DNS proxy".

In this PR, we slightly refactor the handling of the DNS response to
explicitly match on `io::Errorkind::TimedOut` to not send a packet back,
thus mirroring the behaviour the DNS client would encounter without
Firezone being active.
2024-10-14 22:33:53 +00:00
Thomas Eizinger
05e895525b chore: set simpler default log filters (#7028)
Follow-up from #6985 to simplify our log filters everywhere. If any of
this doesn't fit, we should adjust the things here:


17ea827c03/rust/logging/src/lib.rs (L32-L40)
2024-10-14 18:54:36 +00:00
Thomas Eizinger
f9bf681e64 refactor(connlib): track UDP DNS query source in query meta data (#7018)
When performing recursive DNS queries over UDP, `connlib` needs to
remember the original source socket a particular query came from in
order to send the response back to the correct socket. Until now, this
was tracked in a separate `HashMap`, indexed by upstream server and
query ID.

When DNS queries are being retried, they may be resent using the same
query ID, causing "Unknown query" logs if the retry happens on a shorter
interval than the timeout of our recursive query.

We are already tracking a bunch of meta data along-side the actual
query, meaning we can just as easily add the original source socket to
that as well.

Once we add TCP DNS queries, we will need to track the handle of the TCP
socket in a similar manner.
2024-10-14 18:38:39 +00:00
Thomas Eizinger
857bbf5d98 chore(connlib): introduce custom logging format (#7024)
This PR introduces a custom logging format for all Rust-components. It
is more or less a copy of `tracing_subscriber::fmt::format::Compact`
with the main difference that span-names don't get logged.

Spans are super useful because they allow us to record contextual
values, like the current connection ID, for a certain scope. What is IMO
less useful about them is that in the default formatter configuration,
active spans cause a right-drift of the actual log message.

The actual log message is still what most accurately describes, what
`connlib` is currently doing. Spans only add contextual information that
the reader may use for further understand what is happening. This
optional nature of the utility of spans IMO means that they should come
_after_ the actual log message.

Resolves: #7014.
2024-10-14 18:09:38 +00:00
Thomas Eizinger
9302331881 refactor(connlib): create new UDP socket for each DNS query (#6999)
This extracts the initial refactoring required for #6944. Currently,
`connlib` sends all DNS queries over the same UDP socket as all the p2p
traffic for gateways and relays. In an earlier design of `connlib`, we
already did something similar as we are doing here but using
`hickory_resolver` for the actual DNS resolution.

Instead of depending on hickory, we implement DNS resolution ourselves
by sending a UDP DNS query to the mapped upstream DNS server. There are
no retries, instead, we rely on the original DNS client to retry in case
a packet gets lost on the way.

Modelling recursive DNS queries as explicit events from the
`ClientState` is necessary for implement DNS over TCP and DNS over
HTTPS. In both cases, the query to the upstream server isn't as simple
as emitting a `Transmit`. By modelling the query as an `async fn` within
`Io`, it will be possible to perform them all in one place.

Resolves: #6297.
2024-10-11 22:33:22 +00:00
Thomas Eizinger
274cc86557 chore(connlib): add sans-IO DNS-over-TCP client (#7007)
This brings us one step closer to completing #6140. In Firezone, users
can define custom upstream DNS servers that take priority over
system-defined DNS servers. The IPs of these servers could also be
resources, meaning the DNS queries must be sent through the WireGuard
tunnel to the gateway.

For UDP DNS queries, that is easy because each query is only a single
packet. For TCP DNS queries, we need to have a dedicated TCP-capable DNS
server that parses all incoming queries. If they are required to be
forwarded to the gateway, we then need a TCP-capable DNS client that can
send them to the actual upstream DNS server.

This PR implements such a DNS client. The design is tailored for what we
need in `connlib`: We maintain a permanent TCP connection to each
upstream DNS server and send queries to them. Most likely, users will
only have a handful of DNS servers defined. TCP requires a three-way
handshake before any application data can be sent, maintaining a
connection should therefore greatly improve DNS resolution latency.

DNS resolvers are encouraged to keep TCP connections open but may close
them if they run out of resources. We only re-connect once we have more
queries to send in order to not spam the resolver with connections.

Resolves: #7000.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
2024-10-11 22:04:45 +00:00
Reactor Scram
f1cd137e24 feat(rust/gui-client/windows): sign the IPC service exe (#7009)
Closes #7008.

We already signed the GUI exe and the entire MSI package, but when
adding the IPC service we overlooked that one.
This PR:
- Modifies the signing script to accept multiple EXEs
- Modifies the Tauri bundle command to sign both exes
- Updates the changelog

![image](https://github.com/user-attachments/assets/ba58c540-dd0c-42b4-ba62-9c96fc4682c5)
2024-10-11 20:32:50 +00:00
Thomas Eizinger
b40f7d4c62 chore(connlib): trim TRACE logs for DNS resource matching (#6983)
Currently, we emit a single TRACE log for each DNS resource entry that
doesn't match. This is quite spammy and often not needed.

When debugging DNS resources, it is useful to know, which resources we
are matching against. To balance this, we now build a list of all DNS
resource domain patterns that we have and log a single "No resources
matched" log with that list in case none match.
2024-10-11 14:31:06 +00:00
Thomas Eizinger
cd2dea7846 chore: add sans-IO DNS-over-TCP implementation (#6997)
This splits out the actual DNS server from #6944 into a separate crate.
At present, it only contains a DNS server. Later, we will likely add a
DNS client to it as well because the proptests and connlib itself will
need a user-space DNS TCP client.

The implementation uses `smoltcp` but that is entirely encapsulated. The
`Server` struct exposes only a high-level interface for

- feeding inbound packets as well as retrieving outbound packets
- retrieving parsed DNS queries and sending DNS responses

Related: #6140.
2024-10-10 21:05:12 +00:00
Thomas Eizinger
8c4f6bdb0f chore(gateway): don't log WouldBlock on WARN (#6984)
This mirrors what we do on the clients, there is no need to log
`WouldBlock` on `WARN` as those can happen during normal operation.
2024-10-10 19:50:54 +00:00
Reactor Scram
0d134a4f01 chore(rust/gui-client): bump GUI to 1.3.9 to fix a crash (#6993)
Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-10-09 21:44:40 +00:00
Thomas Eizinger
0825055ff2 fix(rust/gui-client): allow GUI process to read the firezone-id file from disk (#6987)
Closes #6989

- The tunnel daemon (IPC service) now explicitly sets the ID file's
perms to 0o640, even if the file already exists.
- The GUI error is now non-fatal. If the file can't be read, we just
won't get the device ID in Sentry.
- More specific error message when the GUI fails to read the ID file

We attempted to set the tunnel daemon's umask, but this caused the smoke
tests to fail. Fixing the regression is more urgent than getting the
smoke tests to match local debugging.

---------

Co-authored-by: _ <ReactorScram@users.noreply.github.com>
2024-10-09 20:04:24 +00:00
Jamil
f5362ce009 docs: Remove known DoH issue with Firefox (#6832)
This has been a long-standing issue.

The base PR fixes the issue for Firefox, and apparently all other
browsers will _not_ change your DNS server, only opportunistically
enable DoH if it finds your current servers to support it.
2024-10-09 19:31:38 +00:00
Thomas Eizinger
17ea827c03 build(rust): bump str0m (#6966)
This includes fixes such as https://github.com/algesten/str0m/pull/569
which reduce the number of packets sent by str0m.
2024-10-09 02:09:34 +00:00
Thomas Eizinger
590edad8fc build(rust): bump proptest (#6965)
With the latest version of `proptest-state-machine`, we no longer need
to use their traits because `Sequential::new` is now exposed. This makes
the overall things less magical because there is less indirection.
2024-10-09 02:08:50 +00:00
Thomas Eizinger
355726db7a refactor(connlib): clarify design of p2p control protocol (#6980)
This incorporates the feedback from #6939 after a discussion with
@conectado. We agreed that the protocol should be more event-based,
where each message has its own event type. Events MAY appear in pairs or
other cardinality combinations, meaning semantically they could be seen
as requests and responses. In general though, due to the unreliable
nature of IP, it is better to view them as events. Events are typically
designed to be idempotent which is important to make this protocol work.
Using events also means it is not as easy to fall into the "trap" of
modelling requests / responses on the control protocol level.
2024-10-09 00:45:30 +00:00
Reactor Scram
637c9d0e20 chore(rust/gtk-client): update lockfile (#6973)
I think this was missed during the last dependabot cycle

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-10-08 22:17:35 +00:00
Reactor Scram
5ef59ed8c1 chore(rust/gtk-client): allow windows to be closed without exiting the app (#6959)
Also allows windows to be closed and re-opened. Tauri behaved exactly
the same way, if you "close" a window it completely destroys it and
panics if you ask to show it again.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-10-08 21:01:34 +00:00
Reactor Scram
41635937c7 chore(rust/gtk-client): fix missing icon (#6958)
Also implement `set_tray_icon`
2024-10-08 20:13:59 +00:00
Thomas Eizinger
2e84ff56f8 chore(phoenix-channel): print elapsed time on test failure (#6963)
Related: #6953.
2024-10-08 20:08:44 +00:00
Reactor Scram
c4ddae7da2 chore(rust/gui-client): cut a GUI release to fix the WSL issue (#6972) 2024-10-08 17:42:46 +00:00
Thomas Eizinger
42f6106527 fix(connlib): default to 443 for websocket endpoint (#6961)
In #6909, we introduced a regression that wasn't caught by CI.
Previously, we were using a different function to resolve the domain
name of the portal. That function took care of handling the case where
the host didn't have a port number.

In the docker-compose file we always specify a port number, therefore
the case of host-only doesn't get tested.

This currently prevents all clients from signing in to staging & prod.
2024-10-08 14:19:24 +00:00
Thomas Eizinger
38c46b41c9 test(connlib): re-add all resources on roaming (#6943)
To correctly handle overlapping CIDR resources, we need to recompute
which ones are active. The `RoamClient` transition was missing that
despite the system-under-test actually doing that bit.

Adding the necessary function call fixes the two regression seeds
detected in CI.

Resolves: #6924.
2024-10-08 06:40:59 +00:00
Thomas Eizinger
02b0e1dc8d chore: don't report authentication errors to sentry (#6948)
Do we want to track 401s in sentry? If we see a lot of them, something
is likely wrong but I guess there is some level of 401s that users will
just run into.

Is there a way of marking these as "might not be a really bad error"?

---------

Co-authored-by: Not Applicable <ReactorScram@users.noreply.github.com>
2024-10-08 06:26:39 +00:00
Thomas Eizinger
027ef60ded feat(connlib): introduce FZ p2p control protocol (#6939)
At present, `connlib` utilises the portal as a signalling layer for any
kind of control message that needs to be exchanged between clients and
gateways. For anything regard to connectivity, this is crucial: Before
we have a direct connection to the gateway, we don't really have a
choice other than using the portal as a "relay" to e.g. exchange address
candidates for ICE.

However, once a direct connection has been established, exchanging
information directly with the gateway is faster and removes the portal
as a potential point of failure for the data plane.

For DNS resources, `connlib` intercepts all DNS requests on the client
and assigns its own IPs within the CG-NAT range to all domains that are
configured as resources. Thus, all packets targeting DNS resources will
have one of these IPs set as their destination. The gateway needs to
learn about all the IPs that have been assigned to a certain domain by
the client and perform NAT. We call this concept "DNS resource NAT".

Currently, the domain + the assigned IPs are sent together with the
`allow_access` or `request_connection` message via the portal. The new
control protocol defined in #6732 purposely excludes this information
and only authorises traffic to the entire resource which could also be a
wildcard-DNS resource.

To exchange the assigned IPs for a certain domain with the gateway, we
introduce our own p2p control protocol built on top of IP. All control
protocol messages are sent through the tunnel and thus encrypted at all
times. They are differentiated from regular application traffic as
follows:

- IP src is set to the unspecified IPv6 address (`::`)
- IP dst is set to the unspecified IPv6 address (`::`)
- IP protocol is set to reserved (`0xFF`)

The combination of all three should never appear as regular traffic.

To ensure forwards-compatibility, the control protocol utilises a fixed
8-byte header where the first byte denotes the message kind. In this
current design, there is no concept of a request or response in the
wire-format. Each message is unidirectional and the fact that the two
messages we define in here appear in tandem is purely by convention. We
use the IPv6 payload length to determine the total length of the packet.
The payloads are JSON-encoded. Message types are free to chose whichever
encoding they'd like.

This protocol is sent through the WireGuard tunnel, meaning we are
effectively limited by our device MTU of 1280, otherwise we'd have to
implement fragmentation. For the messages of setting up the DNS resource
NAT, we are below this limit:

- UUIDs are 16 bytes
- Domain names are at most 255 bytes
- IPv6 addresses are 16 bytes * 4
- IPv4 addressers are 4 bytes * 4

Including the JSON serialisation overhead, this results in a total
maximum payload size of 402 bytes, which is well below our MTU.

Finally, another thing to consider here is that IP is unreliable,
meaning each use of this protocol needs to make sure that:

- It is resilient against message re-ordering
- It is resilient against packet loss

The details of how this is ensured for setting up the DNS resource NAT
is left to #6732.
2024-10-08 05:43:14 +00:00
Thomas Eizinger
b7795dfa03 feat(snownet): introduce upsert_connection (#6937)
One of the key differences of the new control protocol designed in #6461
is that creating new connections is idempotent. We achieve this by
having the portal generate the ICE credentials and the preshared-key for
the WireGuard tunnel. As long as the ICE credentials don't change, we
don't need to make a new connection.

For `snownet`, this means we are deprecating the previous APIs for
making connections. The client-side APIs will have to stay around until
we merge the client-part of the new control protocol. The server-side
APIs will have to stay around until we remove backwards-compatibility
from the gateway.
2024-10-08 01:37:42 +00:00
Thomas Eizinger
4defb3b038 feat(connlib): buffer packets during ICE (#6935)
As part of #6732, we will be using the tunnel for the p2p control
protocol to setup the DNS resource NAT on the gateway. These messages
will be immediately queued after creating the connection, before ICE is
finished. In order to avoid additional retries within `firezone_tunnel`,
we directly attempt to encapsulate these packets.

`boringtun` internally has a buffer for these because prior to having a
WireGuard session, we don't actually have the necessary keys to encrypt
a packet. Thus, the packet passed here won't actually end up in the
referenced buffer of the `Connecting` state. Instead, if we haven't
already initiated a WireGuard handshake, attempting to encapsulate a
packet will trigger a WireGuard handshake initiation and _that_ is the
packet we need to buffer.

Dropping this packet would require us to wait until `boringtun`
retransmits it as part of the handshake timeout, causing an unnecessary
delay in the connection setup.
2024-10-08 00:46:30 +00:00
Thomas Eizinger
41d968b850 refactor(connlib): allow passing IpAddr as well as IpNetwork (#6940)
We call the `add_ips_with_resource` function with a list of `IpAddr` or
`IpNetwork`s. To make this more ergonomic for the caller, we can accept
an iterator that converts the items on the fly.
2024-10-07 22:49:11 +00:00
Thomas Eizinger
0ef4b50913 refactor(ip-packet): be precise about length of payload (#6938)
The `len` specified in the constructor of `IpPacket` is user-provided.
Technically, that one can be longer than the actual packet. To make sure
we only ever pass out the precise payload of the IP packet, we read the
length from the IP header and cut the slice at the specified length.

For #6461, we will build a control protocol on top of IP that runs
through the WireGuard tunnel. Reading the exact length of the payload is
important for that.
2024-10-07 22:48:52 +00:00