Fix DNS resolution across Wi-Fi, cellular, USB tethering, and VPNs

- Add NetworkManager rc-manager=file with dnsmasq caching and baseline /etc/resolv.conf, isolate usb0 routes/DNS in USB_Networking.nmconnection, enable loopback in boot runlevel, and guard 90-nm-cloud-setup.sh for OpenRC.
- Rewrite 50-dns-filter.sh to handle dhcp4/dhcp6/dns events, drop BusyBox-invalid logger -i and blocking gateway sleeps, gate IPv6 AAAA filtering on global unicast addresses and accept_ra, and fall back to 1.1.1.1/9.9.9.9 when no upstream DNS is advertised.
- Fix bananarchy-privacy-ctl musl parallel-query leaks (omit 127.0.0.1 in VPN mode, add sync-dns recovery, replace pkill/pgrep), add usb-tether DNS DNAT, rebuild and verify all four a1120 target images and release zips, and add scripts/test-dns-resolution.py.
This commit is contained in:
Luxferre committed 2026-11-18 13:12:11 +02:00
1 parent 6cedcf980c
commit 63ef9299fc
15 files changed
+764 -105

No files matched your search

+2 -2
View File
@@ -219,7 +219,7 @@ All twenty-five phone applications are compiled as shared-object plugins (`/usr/
- **Open**: select **Networks** or **Bluetooth** from the System menu, or run `xnetworks` / `xbluetooth`.
- **Three connectivity tabs (`Left`/`Right` or `1`–`3`)**:
- **`1:Wi-Fi`**: toggle Wi-Fi radio, rescan (`*`), toggle **Wi-Fi Hotspot**, and connect to WPA2/open networks with a multi-tap password dialog (`*` toggles password visibility).
- **`2:Cell/APN`**: toggle **Mobile Data** (configuring the QMI `bam-dmux` `wwan0` static IPv4 bearer, default route, and DNS automatically), inspect `wwan0` IPv4 status, edit **APN Configuration**, and toggle **USB Tethering**.
- **`2:Cell/APN`**: toggle **Mobile Data** (configuring the QMI `bam-dmux` `wwan0` static IPv4 bearer, default route, and DNS via NetworkManager `rc-manager=file` + local `dnsmasq` caching, with automatic `1.1.1.1`/`9.9.9.9` fallback when a carrier omits DNS), inspect `wwan0` IPv4 status, edit **APN Configuration**, and toggle **USB Tethering** (forwarding tethered `172.16.42.1:53` queries to local `dnsmasq`).
- **`3:Bluetooth`**: toggle **Bluetooth Power** (showing a live `ON (N Active)` badge and starting `/usr/bin/bananarchy-bt-obex`), toggle **Discoverable** (`OFF (Hidden)` by default to avoid continuous Inquiry Scan standby draw, or `ON (Visible for 60s)`, persisted in `~/.config/sxmo/bt_discoverable`), edit the **Bluetooth Device Name** (`Name: <Alias> [Edit]`, persisted in `~/.config/sxmo/bt_name` and applied via `bluetoothctl system-alias` independently of the system hostname), configure the **OBEX File Receiver** (`OBEX Dir: <folder> [Set]`, opening actions to **Set Target Directory...** via an interactive folder picker including `/media/sdcard`, **Open Folder in Files**, or **Reset to ~/Downloads**, persisted in `~/.config/sxmo/bt_obex_dir`; `#` quick-opens the folder in `xfiles`), scan nearby devices (`*` or `Scan`, 15-second discovery scan), and manage paired/discovered devices. Pairing runs via a persistent `KeyboardDisplay` `Agent1` in `/usr/bin/bananarchy-bt-obex` (with `ssp on`, `bondable on`, `linksec on`, `advertising off`, Smartphone class `2 3`, and `PairableTimeout = 0`), popping up an interactive pairing dialog in `xnetworks` for 6-digit passkey confirmation (`Accept & Pair` / `Reject Pairing`), keypad PIN/passkey entry, or outgoing keyboard pairing codes (while auto-confirming screenless Classic Audio headsets). Incoming OBEX file pushes (over both L2CAP `SOCK_SEQPACKET` and RFCOMM, with Smartphone Class of Device `0x5a020c` and no `a2dp_source` role so paired Android phones recognize OPP rather than a headset) pop up an interactive confirmation dialog showing sender, filename, size, **Accept & Save File**, **Dir: ... [Set]** to pick a different destination folder on the spot, and **Reject Transfer**. The scan now drives one interactive `bluetoothctl` client through `script(1)` (`/usr/local/bin/bluetoothctl` -> `/usr/bin/bananarchy-bt-scan.sh`), sets auto transport and duplicate-data, asks the same client for `devices` three times while discovery is active, parses both `[NEW] Device ...` / `[CHG] Device ...` and `Device <MAC> <Name>` lines, and stops discovery cleanly before the client exits; the controller is also powered on automatically if `bluetoothctl show` reports `Powered: no`. A narrow `doas` helper runs `btmgmt -i hci0 le on` alongside BR/EDR SSP/bondable flags before discovery because this WCNSS controller otherwise starts with LE and pairing flags unconfigured. BlueZ keeps `ControllerMode = dual`: `bredr` mode rejects the LE-only HOGP profile, so BLE HID devices would connect at the GATT level but never create a keyboard or mouse input node. **Connect Device** and **Pair & Trust Device** run non-blockingly (`--async-ui`), power the adapter on, enable LE/SSP, select the `le` bearer for HID-over-GATT devices, prefer public BR/EDR entries and the `bredr` bearer (`ConnectProfile` A2DP/HFP fallback) for Classic Audio / dual-mode Bluetooth 5.x/6.x headsets or `OBEX/PAN` phones, and automatically pair unpaired peripherals. Active connections are pinned to the top of the device list with a green border and live profile/battery badges (`[ACTIVE: A2DP]`, `[ACTIVE: HSP/HFP]`, `[ACTIVE: HID Gamepad]`, `[ACTIVE: HID Keyboard]`, `[ACTIVE: HID Mouse]`), and the device actions menu (`Center OK`) provides **Connect Device**, **Disconnect Device**, **Pair & Trust Device**, **Switch Audio (A2DP / HSP-HFP)**, and **Forget / Remove Device**. Supports Bluetooth **A2DP** (`sbc`, `sbc_xq`, `aac`, `ldac` ABR `auto`, `aptx`, `aptx_hd`) with AVRCP hardware volume and Play/Pause/Next/Prev headset button control of `xmusic`, and **HSP/HFP** (`CVSD` 8 kHz over QDSP6 `INTERNAL_BT_SCO`, with `mSBC`/`LC3-A127`/`LC3` and unsupported LE Audio BAP roles disabled, plus headset `ATA` call answer/A2DP restore synchronization), **HID keyboards** (automatically switching `fcitx5-t9` and NeoUI/plugin inputs to `[KBD]` direct QWERTY mode so `0-9`, `*`, `#`, `Shift+0-9`, and letters bypass T9 multi-tap and preedit popups), **HID mice** (automatically showing the X11 mouse cursor whenever a mouse is connected and hiding it when disconnected), and **HID gamepads** (automatically bridged to the phone's D-Pad, softkeys, and action keys via `/dev/uinput`).
13. **Ringtones, notification/SMS sounds, and ringer manager (`ringtones.so` / `xringtones`)**:
@@ -336,7 +336,7 @@ All twenty-five phone applications are compiled as shared-object plugins (`/usr/
- **`3:OVPN` (OpenVPN)**: start/stop OpenVPN (`tun_ovpn`) using any `.ovpn` configuration file selected via the built-in file picker or path editor, and independently toggle **Route Native Traffic** and **Route Wi-Fi/USB Tether** (`table 220`).
- **`4:GS` (GSocket single TCP port)**: start/stop `gs-netcat` (`gsocket`) for a single configurable **TCP Port** (`1`–`65535`) with a custom **GSocket Secret** (or generate a random secret via `gs-netcat -g`), switch between `Client (Out)` and `Server (In)` mode, and independently toggle **Route Native Port** and **Route Tethered Port** (`iptables -t nat REDIRECT` for that TCP port).
- **`5:WG` (WireGuard)**: start/stop a kernel WireGuard interface (`wg0`), generate a fresh Curve25519 keypair (`Generate New Keypair`), import a standard WireGuard `.conf` file, edit custom `PrivateKey`, `Peer PublicKey`, optional `PresharedKey`, `Endpoint (host:port)`, `Interface IP/CIDR`, and `Tunnel DNS`, and independently toggle **Route Native Traffic** and **Route Wi-Fi/USB Tether** (`table 230` with `fwmark 0xca6c` loop avoidance).
- **Zero-drain standby**: no background OpenRC daemons run when services are turned off, and `privacy.so` sleeps at `0%` CPU on `poll()` when hidden.
- **Zero-drain standby & DNS leak protection**: no background OpenRC daemons run when services are turned off, `privacy.so` sleeps at `0%` CPU on `poll()` when hidden, and active VPN tunnels pin only tunneled nameservers (`sync-dns` without `127.0.0.1`) so musl parallel queries never leak outside the tunnel and `/etc/resolv.conf` restores cleanly after tunnel shutdown or reboot.
27. **Engineering menu (`engmenu.so` / `xengmenu`) and extended logging toggle (`bananarchy-engmenu-ctl`)**:
- **Open**: dial **`*#0001#`** (or `###`) in `xdialer`, or run `xengmenu` (hidden and blocked in Duress Mode).