Repository navigation
Conversation
Both found on an Ioniq 5 US 260507 (rc.10) with a mod that downloads over home Wi-Fi. - Connections were refused. The mods' cellular block sat in filter OUTPUT, where -o is the route a packet had before HMG-API's mark (mangle OUTPUT) moved it to table 95: a connection whose first route was the main table's (mobile data) was rejected there, though it would have left on wlan0. With home Wi-Fi on, the IPv4 block for the home group and the mods that asked runs after the reroute instead (mangle POSTROUTING, HMGAPI_HOMECELL: nothing marked leaves on rmnet), and table 95 is never empty: an unreachable default while home Wi-Fi is down, so marked traffic fails rather than falling through to mobile data. IPv6, and everything with home Wi-Fi off, is refused in OUTPUT as before. - A service's resolver (ANDROID_DNS_MODE=local) has no servers in its process and asks 127.0.0.1:53. The DNAT to home Wi-Fi's server kept 127.0.0.1 as the source, which the kernel won't route out of wlan0. While home Wi-Fi is up: route_localnet on wlan0 (the queries are masqueraded by HMGAPI_HOMEOUT), and HMGAPI_HOMELO lets only answers come back in for 127.x. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 26, 2026
# Conflicts: # CHANGELOG.md
HMGAPI_HOMELO lets in, for 127.x on wlan0, only the DNS server's answers (its address, port 53, established), and it is checked on every route_up instead of only when the lease changes: the stock firewall reloading flushes INPUT and can put its own jump first. route_localnet is on only while the guard is first in INPUT; a guard that can't go in is said and route_localnet stays off. The nat OUTPUT jump to HMGAPI_HOMEDNS is checked on every pass too. The network keeper builds the post-reroute DROP, the mark, masquerade, table 95's unreachable default and the fwmark rule before the IPv4 home REJECTs leave, and fills the cellular chain before OUTPUT jumps to it. mods_ok also checks the DROP inside HMGAPI_HOMECELL. wifi.sh down, net.sh down and the uninstaller take table 95's unreachable default out. The test's fake ip route replace/add now key routes as the kernel does (table, destination, metric; not the type), so a default via the gateway replaces the unreachable one. Tested off-car only (homewifi-test.sh with bash, net-test.sh, install/common/test.sh). Not yet checked on a car with the stock whitelist firewall (US Ioniq 6). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With SO_MARK alone a socket uses the main table (mobile data) until the network keeper's fwmark rule is in; HMG-API's own downloads bind to wlan0 too and fail if either is refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VysseCodes
reviewed
Nov 30, 2026
VysseCodes
left a comment
Collaborator
There was a problem hiding this comment.
Three notes:
- Flush order in
route_up:HMGAPI_HOMELOis flushed whileroute_localneton wlan0 is still 1, so for a moment 127/8 from wlan0 isn't guarded. Please setroute_localnetto 0 first, then flush. - Cellular block by mark only:
HMGAPI_HOMECELLdrops-o rmnet+traffic carrying mark 0x2951. If the mark rule goes missing (flushed, failed restore), home mods' traffic could reach cellular. Please also drop home mods' uids/gid onrmnet+with an owner match, so the block holds without the mark. - "No gap" claim: the repair path (
mods_fw_down; mods_up) still leaves a short gap, as it did before this PR. Not a blocker, but please soften the claim in the description/comments or close that path too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wner DROPs on rmnet, no_route here) - route_up: route_localnet is set to 0 before HMGAPI_HOMELO is flushed for a new DNS server, so 127/8 from wlan0 is never unguarded (test: every flush sees 0). - HMGAPI_HOMECELL also drops the home group's and the home apps' traffic on rmnet+ by owner, so the block holds if the mark rule is lost; mods_ok counts its rules. - no_route() moves here from #419, which never called it. - The comments and changelog no longer claim a repair has no gap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AwsomeFox
added a commit
that referenced
this pull request
Nov 30, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AwsomeFox
added a commit
that referenced
this pull request
Nov 30, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
All three done in 32f9c50:
|
6 of 67 tasks
|
Data point from a US EV6 (CVEV, 260507) on HMG-API 1.1.0: a test mod with "wifi": {"home": true} showed Home Wi-Fi as up (rssi -30), plex.tv resolved fine, but every TCP connect to port 443 came back ECONNREFUSED. That looks like the HMGAPI_CELL reject you describe here, right? Joining through NEMESIS's Wi-Fi instead worked. Is there a test build of #419/#420 I could try? Happy to send logs. |
…outing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AwsomeFox
added a commit
that referenced
this pull request
Dec 2, 2026
The only conflict was tools/test-all.sh: this branch's fetch-test.sh and release/2.0's core/client/test.sh both go in ALL and FAST. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack: 2 of 5, on #419 (same files). Review after #419.
Both found on an Ioniq 5 US 260507 (rc.10) with a test mod that downloads over Home Wi-Fi, once #419 let it join.
1. Mods' connections over Home Wi-Fi were refused
HMGAPI_CELLsits infilter OUTPUTwith-o rmnet+ -m owner --gid-owner 2951 -j REJECT(and the home mods' uids). In OUTPUT,-ois the interface from the initial route lookup. HMG-API's mark comes later (mangle OUTPUT→ reroute to table 95). A TCP connect to the internet first routes by the main table (default via rmnet0), so its SYN was rejected even though it would have left onwlan0. On the car:HMGAPI_CELLcounted the rejected SYNs, andHMGAPI_HOMEOUT's MASQUERADE only matched DNS to the on-link router.Fix (
Network.java,wifi.sh):mangle POSTROUTING→HMGAPI_HOMECELL:-o rmnet+ -m mark --mark 0x2951 -j DROP, after the reroute, so nothing marked ever leaves on mobile data.unreachable defaultwhile Home Wi-Fi is down (keeper start,route_down), so marked traffic fails rather than falling through to the main table.mods_okcounts the new rule set and checks the POSTROUTING jump.2. Services' DNS lookups never left the unit
A service runs with
ANDROID_DNS_MODE=local. On these units that resolver has no servers in the service's process (they live in netd's cache), so bionic asks127.0.0.1:53.HMGAPI_HOMEDNSDNATs those to Home Wi-Fi's server but the source stays127.0.0.1, which the kernel won't route out ofwlan0. Seen innf_conntrack:src=127.0.0.1 dst=127.0.0.1 dport=53 [UNREPLIED]for every lookup.Fix (
wifi.sh, while Home Wi-Fi is up):route_localnet=1onwlan0(the queries are masqueraded byHMGAPI_HOMEOUT, so nothing leaves as 127.0.0.1), plusHMGAPI_HOMELOfirst in INPUT:-i wlan0 -d 127.0.0.0/8only forESTABLISHED,RELATED, everything else dropped, so the home network can't reach the unit's loopback services. Both come off inroute_down.Tested
homewifi-test.sh: 172 checks (the new rule sets, the unreachable default, route_localnet on and off, the guard). The fakeiplearnedroute addandroute show table N.net-test.sh.iptrules, e.g. US Ioniq 6). Home Wi-Fi replies onwlan0may need a rule there too; this PR doesn't change that.Review follow-ups (Nov 30)
route_up:route_localnetgoes to 0 beforeHMGAPI_HOMELOis flushed for a new DNS server, so 127/8 from wlan0 is never unguarded (tested: every flush sees 0).HMGAPI_HOMECELLalso drops the home group's (gid 2951) and the home apps' (uid) traffic onrmnet+by owner, so the block holds without the mark;mods_okchecks those rules.no_route()moved here from Home Wi-Fi: keep the car's Wi-Fi checksum in step, so the client starts #419.mods_fw_down; mods_up) still has a short gap, as before this PR.🤖 Generated with Claude Code