Repository navigation
VTesse 2.0.0: userspace only — inbound forwards, ip=learn, default-route wait, TAP backend removed - #74
Conversation
PR Summary by QodoVTesse 2.0.0: userspace-only networking and inbound access
AI Description
Diagram
High-Level Assessment
Files changed (31)
|
Code Review by Qodo
1. The learning test omits its broadcast case
|
…checks before the wait
79a820a to
fe5b656
Compare
|
/review |
|
Code review by qodo was updated up to the latest commit fe5b656 |
fe5b656 to
06fdd8e
Compare
|
/review |
| until logs | grep -q "waiting for the first packet" || [ $i -gt 20 ]; do sleep 1; i=$((i + 1)); done | ||
| # shellcheck disable=SC2034 # sha, t0: used inside the eval strings of check | ||
| sha=$(docker exec "$c" cat /tmp/www/big.sha256) | ||
| check "ip=learn: no address before the first packet" '! logs | grep -q "address 10.76"' | ||
| check "accept: the server reaches the client's web server (first SYN teaches the address)" \ | ||
| 'srv "curl -fsS --max-time 10 -o /dev/null http://10.76.0.2:8080/big.sha256"' | ||
| check "ip=learn: address 10.76.0.2/32, peer 10.76.0.1" \ | ||
| 'logs | grep -q "address 10.76.0.2 mask 255.255.255.255 (learnt), peer 10.76.0.1"' |
There was a problem hiding this comment.
1. The learning test omits its broadcast case 📎 Requirement gap ⚙ Maintainability
cmd_accept_test waits for the first-packet message and then immediately uses a unicast HTTP SYN to teach the address, without injecting a broadcast, multicast or zero-destination packet first. A regression that incorrectly learns from excluded traffic would therefore pass the acceptance suite, leaving the address-learning lifecycle requirement unverified.
Agent Prompt
## Issue description
The inbound acceptance test does not verify that broadcast, multicast, or 0.0.0.0 destinations are ignored before the first valid unicast packet teaches the address. It also should exercise the required pre-learning outbound failure behavior so regressions in the address-learning lifecycle are caught.
## Fix Focus Areas
- bench/bench.sh[177-184]
## Recommended Fix
Before the first valid HTTP SYN, send or trigger representative broadcast, multicast, and 0.0.0.0-destination traffic through the type-tun session and assert that no address is learned. Add checks that outbound SOCKS5 and static-forward attempts fail before learning, then retain the existing unicast SYN check to confirm the valid packet teaches the address.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Code review by qodo was updated up to the latest commit 06fdd8e |
VTesse 2.0.0: the userspace stack only. Closes #67, closes #68, closes #72, closes #73.
Commits
--show-configand--installdo not wait. Bench:route-wait-test.accept=PORT[:IP:PORT]/--accept(up to 4). An lwIP listener per port on the tunnel address; each connection is relayed to a host socket, by default the same port on the address of the default-route interface (looked up per connection,netcore/hostaddr.c) — the device's own LAN address, so its web interface asks for the password as from the LAN (owner decision; the issue said127.0.0.1, which stays available explicitly). The host connect is non-blocking; data from the tunnel waits unacknowledged until it completes; a refused or silent local port aborts the PCB (RST). Shares the proxy's connection limit.MEMP_NUM_TCP_PCB_LISTEN1 → 4.ip=learn(lwIP: learn the address from the first inbound packet on type tun (ip=learn) #68) in the lwIP stack: the destination of the first unicast packet of atype tunsession is the address (/32), its source the peer, set before the packet enters lwIP. After a reconnect the next packet is checked again: a changed address replaces the old one, the same address changes nothing (rather than a reset on every reconnect, which would flap the address).type etherwithip=learnstops the client with exit code 2.netcore/tapdev.c,--tap/--ifname/--hook(refused with the reason),LWIP=0/TAP=0, the hook and udhcpc scripts (built-in copies and release files),--install --scripts, the 1.13 hook migration. CI: the TAP-only build andtap-testreplaced byaccept-test.--installaddsaccept=80,accept=22,accept=554to a configuration withoutacceptlines, and a client started from the U-Boot environment withoutacceptlines opens the same ports — the camera's web interface, ssh and RTSP, as the TAP backend gave them. Updating a 1.x installation removes the old hook scripts and reports--tapin/etc/default/vtesse(left for the user to clean).docs/usage.md(new "Inbound forwards",ip=learn),architecture.md,security.md,testing.md,bench/README.md.Checked locally (Docker, as CI): unit tests (+ ASan/UBSan), the minimal build, all five musl targets with the unit tests under qemu, the Android debug APK, the version check, and the bench:
selftest,cli-test,accept-test,tun-test,udp-test,fault-test,route-wait-test.proxy-testcould not run locally (its host ports 18080/18554 were taken by an unrelated process on the build machine); CI runs it.