Merge pull request #57 from aramperes/chore/update-docker-rust-version

This commit is contained in:
Aram 🍐 2023-12-21 15:21:58 -05:00 committed by GitHub
commit 767b83d241
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 9 deletions

View file

@ -10,7 +10,7 @@ jobs:
matrix: matrix:
rust: rust:
- stable - stable
- 1.63.0 - 1.65.0
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -39,7 +39,7 @@ jobs:
matrix: matrix:
rust: rust:
- stable - stable
- 1.63.0 - 1.65.0
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v2 uses: actions/checkout@v2

View file

@ -1,4 +1,4 @@
FROM rust:1.63.0 as cargo-build FROM rust:1.65.0 as cargo-build
WORKDIR /usr/src/onetun WORKDIR /usr/src/onetun
COPY Cargo.toml Cargo.toml COPY Cargo.toml Cargo.toml

View file

@ -21,7 +21,7 @@ For example,
## Download ## Download
onetun is available to install from [crates.io](https://crates.io/crates/onetun) with Rust ≥1.63.0: onetun is available to install from [crates.io](https://crates.io/crates/onetun) with Rust ≥1.65.0:
```shell ```shell
cargo install onetun cargo install onetun
@ -37,7 +37,7 @@ docker run --rm --name onetun --user 1000 -p 8080:8080 aramperes/onetun \
0.0.0.0:8080:192.168.4.2:8080 [...options...] 0.0.0.0:8080:192.168.4.2:8080 [...options...]
``` ```
You can also build onetun locally, using Rust ≥1.63.0: You can also build onetun locally, using Rust ≥1.65.0:
```shell ```shell
git clone https://github.com/aramperes/onetun && cd onetun git clone https://github.com/aramperes/onetun && cd onetun

View file

@ -119,8 +119,7 @@ impl smoltcp::phy::TxToken for TxToken {
where where
F: FnOnce(&mut [u8]) -> smoltcp::Result<R>, F: FnOnce(&mut [u8]) -> smoltcp::Result<R>,
{ {
let mut buffer = Vec::new(); let mut buffer = vec![0; len];
buffer.resize(len, 0);
let result = f(&mut buffer); let result = f(&mut buffer);
self.sender self.sender
.send(Event::OutboundInternetPacket(buffer.into())); .send(Event::OutboundInternetPacket(buffer.into()));

View file

@ -229,7 +229,7 @@ impl VirtualInterfacePoll for TcpVirtualInterface {
next_poll = None; next_poll = None;
} }
} }
Event::VirtualDeviceFed(protocol) if protocol == PortProtocol::Tcp => { Event::VirtualDeviceFed(PortProtocol::Tcp) => {
next_poll = None; next_poll = None;
} }
_ => {} _ => {}

View file

@ -198,7 +198,7 @@ impl VirtualInterfacePoll for UdpVirtualInterface {
} }
next_poll = None; next_poll = None;
} }
Event::VirtualDeviceFed(protocol) if protocol == PortProtocol::Udp => { Event::VirtualDeviceFed(PortProtocol::Udp) => {
next_poll = None; next_poll = None;
} }
_ => {} _ => {}