Skip to content

fix(network): respect configured bind address - #5700

Open
ReenigneArcher wants to merge 1 commit into
masterfrom
fix/5651
Open

fix(network): respect configured bind address#5700
ReenigneArcher wants to merge 1 commit into
masterfrom
fix/5651

Conversation

@ReenigneArcher

Copy link
Copy Markdown
Member

Description

Use IPv4 sockets when an explicit IPv4 bind address is configured in dual-stack mode. This preserves bind failures for unavailable addresses while avoiding protocol mismatches.

Generate Web UI launch links from the configured address and bracket IPv6 literals. Document the address requirements and cover effective families and generated URLs with unit tests.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

See our AI usage policy.

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 124 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sunshine-esm 864.73kB 124 bytes (0.01%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sunshine-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/logo-*.js 124 bytes 381.88kB 0.03%

Files in assets/logo-*.js:

  • ./src_assets/common/assets/web/public/assets/locale/en.json → Total Size: 52.76kB

Comment thread tests/unit/test_entry_handler.cpp Outdated
* @brief Test that Web UI URLs use the configured IPv4 bind address.
*/
TEST_F(LaunchUiUrlTest, UsesConfiguredIPv4Address) {
config::sunshine.bind_address = "100.70.253.56";
Comment thread tests/unit/test_network.cpp Outdated
* @brief Test that an explicit IPv4 bind address selects an IPv4 socket.
*/
TEST_F(BindAddressTest, IPv4AddressSelectsIPv4Family) {
config::sunshine.bind_address = "10.0.0.101";
Comment thread tests/unit/test_network.cpp Outdated
config::sunshine.bind_address = "";
EXPECT_EQ(net::get_bind_address_url_host(), "localhost");

config::sunshine.bind_address = "100.70.253.56";
@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.76%. Comparing base (2ebaae3) to head (370de03).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/entry_handler.cpp 66.66% 2 Missing ⚠️
src/confighttp.cpp 0.00% 1 Missing ⚠️
src/network.cpp 93.33% 1 Missing ⚠️
src/rtsp.cpp 0.00% 1 Missing ⚠️
src/stream.cpp 0.00% 1 Missing ⚠️
src/upnp.cpp 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5700      +/-   ##
==========================================
+ Coverage   37.67%   37.76%   +0.08%     
==========================================
  Files         104      104              
  Lines       26103    26124      +21     
  Branches    11561    11566       +5     
==========================================
+ Hits         9834     9865      +31     
- Misses      12569    14810    +2241     
+ Partials     3700     1449    -2251     
Flag Coverage Δ
Alpine-aarch64 22.71% <52.38%> (+0.13%) ⬆️
Alpine-x86_64 22.84% <52.38%> (+0.13%) ⬆️
Archlinux 21.43% <52.38%> (+0.14%) ⬆️
FreeBSD-amd64 23.66% <68.00%> (+0.17%) ⬆️
Homebrew-macos-15 37.46% <68.18%> (+0.18%) ⬆️
Homebrew-macos-26 37.75% <68.18%> (+0.17%) ⬆️
Homebrew-ubuntu-24.04 24.73% <57.14%> (+0.14%) ⬆️
Linux-AppImage-aarch64 26.04% <57.14%> (?)
Linux-AppImage-x86_64 26.22% <57.14%> (+0.17%) ⬆️
Windows-AMD64 30.57% <57.14%> (+0.15%) ⬆️
Windows-ARM64 25.64% <68.00%> (+0.18%) ⬆️
macOS-arm64 31.03% <68.00%> (+0.21%) ⬆️
macOS-x86_64 31.65% <68.00%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/network.h 50.00% <ø> (ø)
src/confighttp.cpp 57.43% <0.00%> (-0.04%) ⬇️
src/network.cpp 70.83% <93.33%> (+10.99%) ⬆️
src/rtsp.cpp 23.04% <0.00%> (-0.04%) ⬇️
src/stream.cpp 22.74% <0.00%> (ø)
src/upnp.cpp 27.48% <0.00%> (ø)
src/entry_handler.cpp 10.68% <66.66%> (+4.38%) ⬆️

... and 49 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ebaae3...370de03. Read the comment docs.

@github-actions

Copy link
Copy Markdown
Last Updated 2026-09-12 23:10:31 UTC
Source Run CI Run #5504
Commit 370de0389c4c79d2473c7e571ca0e872ee1d4577

Screenshot Comparison

PR #5700 screenshots vs screenshots baseline.

Matrix: AppImage-aarch64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: AppImage-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-AMD64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-ARM64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-arm64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Use IPv4 sockets when an explicit IPv4 bind address is configured in dual-stack mode. This preserves bind failures for unavailable addresses while avoiding protocol mismatches.

Generate Web UI launch links from the configured address and bracket IPv6 literals. Document the address requirements and cover effective families and generated URLs with unit tests.
@sonarqubecloud

Copy link
Copy Markdown

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.

error log for sunshine crashing System tray launches Web UI at localhost even if bind_address is configured

2 participants