| Path | Description |
|---|---|
/opt/uu/bin/uu-monitor.sh |
Supervisor / updater (rewritten from h3c_uuplugin_monitor.sh), main process of uu.service |
/opt/uu/bin/uu-gateway.sh |
Bypass gateway rules, dnsmasq launcher |
/opt/uu/bin/uuctl |
Management command (/usr/local/bin/uuctl) |
/opt/uu/shim/ |
Command shims used only by uuplugin (see below) |
/opt/uu/musl/<arch>/ |
musl runtime; /lib/ld-musl-aarch64.so.1 or /lib/ld-musl-arm.so.1 points here |
/opt/uu/qemu/qemu-aarch64 |
amd64 Docker image only: patched QEMU that runs the aarch64 plugin (x86_64) |
/opt/uu/LICENSE, THIRD_PARTY_NOTICES.md, licenses/ |
Licenses (/usr/share/doc/uu-plugin-linux/ in the Docker image) |
/etc/uu/ |
Configuration and SN file |
/var/lib/uu/uu.tar.gz |
Plugin package cache (persistent, so the plugin also starts when booting offline) |
/var/tmp/uu/ |
Plugin working directory (path hard-coded in the plugin) |
/etc/systemd/system/uu.service, uu-dns.service |
systemd services |
-
musl runtime: the H3C
uupluginis dynamically linked against musl and cannot run on glibc distributions as is. The package ships the required libraries inruntime/<arch>/(fetch-runtime.shcan re-download and rebuild them). They are installed to/opt/uu/musl/<arch>, and/etc/ld-musl-<arch>.pathsets the search path, without affecting glibc programs on the system.Architecture Plugin Runtime source aarch64 H3C NX30Pro ld-musl-aarch64.so.1, libstdc++, libgcc_s: Alpine 3.22armv7 H3C BX54 (soft-float ABI) ld-musl-arm.so.1, libstdc++, libgcc_s: Bootlin armv5-eabi musl toolchain; libssl/libcrypto 1.1: OpenWrt 22.03arm_arm926ej-sarmv7 pitfalls: the plugin uses the soft-float ABI (
ld-musl-arm.so.1), while Alpine only ships hard-float; OpenWrt's libstdc++ is built without the C++11 ABI (missingstd::__cxx11symbols), so Bootlin's is used; and libcrypto carries a 2-byte patch (next item). -
OpenSSL initialization on armv7: the H3C BX54
uupluginexports its ownatexit, whose body is justreturn -1. Under musl, libcrypto'satexit(OPENSSL_cleanup)binds to this stub, so OpenSSL 1.1.1 considers initialization failed and everySSL_CTX_newreturns NULL. The symptom is that the plugin opens a TCP connection to the server, closes it immediately and never logs in. The bundled libcrypto points its importedatexitsymbol at the existingsched_yieldstring in its string table (no arguments, always returns 0), i.e. "registration succeeds but does nothing", which matches H3C's intent of not registering exit handlers (fetch-runtime.shverifies the md5 and applies this patch automatically). The aarch64 plugin links OpenSSL statically and is not affected. -
iptables extensions: the plugin runs commands as
XTABLES_LIBDIR=/lib iptables .... On Debian/Ubuntu the iptables extensions are not in/lib, so every--dport,-j MARKand-j DNATrule fails. The monitor puts/opt/uu/shimfirst in the plugin's PATH; the shim clears that variable and then calls the system iptables. -
LAN interface: the H3C plugin assumes the LAN interface is
br-lan(the OpenWrt bridge) and guesses the bridge withbrctl show | grep br-(which would pick a dockerbr-xxxxbridge on the host). The plugin config supports alan_ifnamekey; after every extraction/update the monitor writeslan_ifname=<LAN_IF>intouu.conf, and thebrctlshim returns nothing. Plain interfaces (eth0/end0 etc.) do not need to be turned into bridges. -
Process detection: the original script parsed busybox
psoutput; this one reads/proc/<pid>(note that the kernel truncates the process name ofxuplugin-guardianto 15 characters:xuplugin-guardi). The original bug that deletedh3c_info(already fixed in the OpenWrt port) is avoided here as well:h3c_infois kept and refreshed from/etc/uu/factoryinfobefore every start. -
Automatic updates:
- On start: query the latest package md5 from
router.uu.163.com; if it differs from the cache, download it (primary/backup URLs), verify the md5 and that the package containsuuplugin, then replace the cache. Every start re-extracts from the cache, so the latest version always runs - Network not ready at boot: wait up to
UPDATE_WAITseconds, then start with the cached version and retry in the background every 10 minutes, switching as soon as a new version appears; without a cache, keep retrying until a download succeeds - While running: when the plugin finds a new version it writes
uu.updateand exits; the monitor downloads the new package and restarts the plugin (same as the original)
- On start: query the latest package md5 from
-
Bypass gateway (
uu-gateway.sh; all rules live in dedicated chainsUU_GW_IN/UU_GW_FWD/UU_GW_NAT):net.ipv4.ip_forward=1send_redirectsdisabled: clients share the subnet with the main router, otherwise this machine would send ICMP redirects pointing clients back to the main router- Strict
rp_filter(1) relaxed to loose (2), so replies from the plugin's tun interface are not dropped FORWARDaccepts LAN traffic (for hosts where docker / ufw set the FORWARD policy to DROP)- MASQUERADE for LAN traffic to the internet
INPUTaccepts port 53 on the LAN interface- The monitor checks every minute and re-applies the rules if a firewall reload flushed them or the LAN address changed; everything is removed when the service stops
- IPv4 only; IPv6 is not forwarded, and
ip6tablesonly allows LAN access to the local DNS
-
DNS:
uu-dns.serviceruns a separate dnsmasq instance (--conf-file=/dev/null, ignoring the system dnsmasq configuration), listening only on the LAN interface addresses (IPv4 and IPv6), without DHCP, and coexisting with systemd-resolved (127.0.0.53);--filter-AAAAis on by default, see IPv6.