Skip to content

fix: support IPv6-only hosts in event server - #1066

Open
Ajnasz wants to merge 1 commit into
xbmc:masterfrom
Ajnasz:fix/event-server-ipv6
Open

Ajnasz wants to merge 1 commit into
xbmc:masterfrom
Ajnasz:fix/event-server-ipv6

Conversation

@Ajnasz

@Ajnasz Ajnasz commented Oct 10, 2026 •

Copy link
Copy Markdown

The Event Server lookup accepted only IPv4 addresses. If a host name had only an AAAA record, the lookup threw UnknownHostException and Kore turned the Event Server off.

Kore now prefers an IPv4 address and falls back to IPv6, so IPv6-only host names work with the Event Server.

Tested:

  • Debug build succeeds.
  • Sent Event Server PING packets over UDP to an IPv6 address and got no ICMP errors.
  • The unit tests were not run.

Related to #1042. This does not add support for IPv6 link-local addresses with a scope, which is what that issue asks for.

Summary by CodeRabbit

  • Bug Fixes
    • Improved host address resolution when connecting to or testing a connection, including support for hosts that resolve only to non-IPv4 addresses.

getInet4AddressByName threw UnknownHostException for hosts with only
an AAAA record, which disabled the Event Server. Replace it with
getInetAddressByName, which prefers IPv4 and falls back to IPv6.
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2bfac177-6f14-4070-ad14-3ae738c5c867

📥 Commits

Reviewing files that changed from the base of the PR and between 5c686f6 and 55b8b3c.


📒 Files selected for processing (2)
  • app/src/main/java/org/xbmc/kore/eventclient/EventServerConnection.java
  • app/src/main/java/org/xbmc/kore/utils/NetUtils.java

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.



📝 Walkthrough

Walkthrough

The address lookup method now returns an IPv4 address when one is available, or the first DNS result otherwise. Event server connection setup and testing use this method.

Changes

Event Server Address Resolution

Layer / File(s) Summary
Address lookup and event server call sites
app/src/main/java/org/xbmc/kore/utils/NetUtils.java, app/src/main/java/org/xbmc/kore/eventclient/EventServerConnection.java
getInetAddressByName returns the first IPv4 address found, or the first DNS result if none is IPv4. Connection setup and testing use this method. Existing lookup-failure handling remains unchanged.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix


Merge Risk | ⚪ Minimal · up to 55b8b

Merge Risk: ⚪ Minimal · up to 55b8b

IPv4 remains preferred, while IPv6-only DNS results can reach the Event Server UDP send path. No actionable merge risk was found; successful delivery still depends on the device’s IPv6 network configuration.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 55b8b

The change intentionally expands network reachability while retaining IPv4 preference and existing host-selection controls. No introduced security defect was established. Destination trust still depends on configured hosts and DNS, and IPv6 delivery across supported devices has not been demonstrated.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The newly reachable scope is the selected IPv6 address and configured Event Server UDP port for each connection or test. Resolution applies no destination allowlist, so effective exposure depends on host configuration, DNS answers and the device's network reachability.

Security Findings and Attack Paths

  • inferred — An actor able to influence a configured hostname's DNS answers could redirect these UDP packets to an IPv6 destination when no IPv4 answer exists. DNS-selected IPv4 destinations were already trusted at the base; this is an expanded address-family exposure, not a verified new authorization bypass.

Trust Boundaries and Controls

  • observed — Host configuration and user-selected Zeroconf discovery supply HostInfo addresses. Connection testing reads mute state through a separate JSON-RPC connection, while UDP commands use the captured resolved address. That state comparison does not itself authenticate the UDP destination.

Resilience and Maintainability Implications

  • observed — The test's mute mutation remains best-effort rather than atomic: a failed post-MUTE state read skips restoration, and restoration-send failure is only logged. These paths predate the PR. Normal remote operation stops its owned connection on onStop; IPv6 fallback does not alter that cleanup.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding support for IPv6-only hosts in the event server connection flow.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

The Event Server now accepts IPv6 addresses when a host has no IPv4 address.

  • Event Server connections now accept IPv6-only host names.

Ajnasz explicitly states that support for scoped IPv6 link-local addresses is outside this PR.

Reviews (1) · Last reviewed commit: "fix: support IPv6-only hosts in event se..." · Reviewed by Greptile

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.

1 participant