add ipv6Pref to HTTPTunnelPort by munzzyy · Pull Request #1792 · guardianproject/orbot-android · GitHub
Skip to content

add ipv6Pref to HTTPTunnelPort - #1792

Merged
bitmold merged 1 commit into
guardianproject:masterfrom
munzzyy:fix/httptunnelport-ipv6pref
Aug 30, 2026
Merged

bitmold merged 1 commit into
guardianproject:masterfrom
munzzyy:fix/httptunnelport-ipv6pref

Conversation

@munzzyy

@munzzyy munzzyy commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Fixes #1420

SOCKSPort gets $ipv6Pref appended in both branches (open-on-all-interfaces and the default) so IPv6Traffic/PreferIPv6/NoIPv4Traffic follow whatever the user picked in the UI, but HTTPTunnelPort was missing the same flags, so the IPv6 setting never reached the http tunnel.

One-line fix, appends $ipv6Pref to the HTTPTunnelPort line the same way SOCKSPort already does.

The tor man page only documents isolation flags for HTTPTunnelPort, so I checked the parser before trusting this: in tor's config.c, HTTPTunnelPort is parsed by port_parse_config with CL_PORT_TAKES_HOSTNAMES set, and IPv6Traffic/PreferIPv6 are accepted exactly when that flag is set, same as SocksPort. The flags are valid there even though the man page does not list them.

No JVM-level test for this one. TorConfig.build() reads through Prefs, which needs a real android.content.Context backing SharedPreferences, and there's no Robolectric (or similar) in this project to fake that at the JVM level, so a meaningful unit test here would mean adding a chunk of test infrastructure for a one-line change.

SOCKSPort already gets $ipv6Pref appended so IPv6Traffic/PreferIPv6/
NoIPv4Traffic follow the user's setting, but HTTPTunnelPort was missing
the same flags, so IPv6 selections made in the UI only applied to the
socks proxy and not the http tunnel. Tor's client port options
(IPv6Traffic, PreferIPv6, NoIPv4Traffic) are valid on HTTPTunnelPort the
same as SOCKSPort, so append it there too.
@bitmold
bitmold merged commit 07f6a40 into guardianproject:master Aug 30, 2026
@bitmold

bitmold commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] IPv6Traffic PreferIPv6 are not used for HTTPTunnelPort when marked in the UI

2 participants