LizardByte / Sunshine

Self-hosted game stream host for Moonlight.
http://app.lizardbyte.dev/Sunshine/
GNU General Public License v3.0
18.08k stars 871 forks source link

Only those in LAN may access Web UI ipv6 support #1775

Open axet opened 11 months ago

axet commented 11 months ago

Is there an existing issue for this?

Is your issue described in the documentation?

Is your issue present in the nightly release?

Describe the Bug

Config option "Only those in LAN may access Web UI" working incorrectly. Current implementation only only check IPv4 for unroutable address. But here is also IPv6 with unrotable (local link) addresses. You can see all unroutable addresses in wikipeida:

Expected Behavior

No response

Additional Context

No response

Host Operating System

Linux

Operating System Version

bookworm

Architecture

64 bit

Sunshine commit or version

0.21.0

Package

Linux - flatpak

GPU Type

AMD

GPU Model

rx 6600

GPU Driver/Mesa Version

0000

Capture Method (Linux Only)

No response

Config

000

Apps

No response

Relevant log output

000
cgutman commented 10 months ago

Yes, this is a known limitation of our IPv6 support. We do not currently have any method of enumerating interfaces and addresses in our platform-specific backends, so we can't tell if a given address is on-link or not.

axet commented 10 months ago

No need for that. Listening 0.0.0.0 - makes you ipv4 only. Listening :: makes you ipv4/ipv6. You have peer address which can be validated for local node connection / remote connection.

cgutman commented 10 months ago

I don't understand what you're suggesting. Yes, we can listen on 0.0.0.0 or :: and that's exactly what we already do depending on whether you selected IPv4-only or IPv6+IPv4 in Sunshine's configuration.

As I mentioned, we need to know whether the peer address is on-link or not. Unlike IPv4, you can't easily know that based on the address alone. You need to enumerate the assigned addresses and subnet masks on local interfaces to determine on-link destinations, and that isn't implemented yet.

axet commented 10 months ago

Not true. Unless you also want to add routable local IPv6 addresses, which BTW I do not recommend. IPv6 not a bit different from IPv4.

Check unroutable addesses (local link)

LizardByte-bot commented 7 months ago

It seems this issue hasn't had any activity in the past 90 days. If it's still something you'd like addressed, please let us know by leaving a comment. Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks!