Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/connections: allow IPv6 ULA in discovery #9048

Merged
merged 2 commits into from
Aug 23, 2023
Merged

Conversation

bt90
Copy link
Contributor

@bt90 bt90 commented Aug 21, 2023

Purpose

Fixes #7456

The allowed IPv4 ranges are the same as before. But we now also accept IPv6 addresses in the ULA range FC00::/7. These addresses don't require an interface identifier and are roughly equivalent to the IPv4 private ranges.

Typical usecases:

  • VPN interface IPs: Wireguard, OpenVPN, Tailscale, ...
  • fixed IPv6 LAN addressing while the provider assigns a dynamic prefix. e.g used by pihole

https://cs.opensource.google/go/go/+/refs/tags/go1.21.0:src/net/ip.go;l=146

Testing

I checked the output of https://discovery.syncthing.net/?device=xxxxxxxxxxxxxxxxxxxx and my local fd00:: IPs were listed.

@bt90 bt90 changed the title WIP: Switch to IP.IsPrivate() WIP: lib/connections allow IPv6 ULA Aug 21, 2023
@bt90 bt90 marked this pull request as draft August 21, 2023 16:26
@bt90 bt90 changed the title WIP: lib/connections allow IPv6 ULA lib/connections allow IPv6 ULA Aug 22, 2023
@bt90 bt90 marked this pull request as ready for review August 22, 2023 11:48
@bt90 bt90 changed the title lib/connections allow IPv6 ULA lib/connections: allow IPv6 ULA Aug 22, 2023
@bt90
Copy link
Contributor Author

bt90 commented Aug 23, 2023

@calmh any objections?

Copy link
Member

@calmh calmh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is about discovery? The title says "lib/connections: allow ..." but we allow connections to/from all addresses by default always.

lib/connections/util.go Outdated Show resolved Hide resolved
@bt90
Copy link
Contributor Author

bt90 commented Aug 23, 2023

This is strictly discovery related, yes.

@bt90 bt90 changed the title lib/connections: allow IPv6 ULA lib/connections: allow IPv6 ULA in discovery Aug 23, 2023
@bt90 bt90 requested a review from calmh August 23, 2023 09:39
@calmh calmh merged commit 467522d into syncthing:main Aug 23, 2023
23 checks passed
@calmh calmh added this to the v1.24.0 milestone Aug 23, 2023
@bt90 bt90 deleted the bt90-patch-2 branch August 23, 2023 10:34
calmh added a commit to calmh/syncthing that referenced this pull request Aug 29, 2023
* main:
  gui, man, authors: Update docs, translations, and contributors
  cmd/stdiscosrv: Separate HTTPS and replication certificates
  cmd/stdiscosrv: Use larger database settings
  cmd/stdiscosrv: Modernise TLS settings, remove excessive HTTP logging
  cmd/stdiscosrv: Serve compressed responses
  lib/connections: Allow IPv6 ULA in discovery announcements (fixes syncthing#7456) (syncthing#9048)
calmh added a commit to calmh/syncthing that referenced this pull request Sep 1, 2023
* main: (121 commits)
  build: Update dependencies
  gui: Remove footer and move links to header (fixes syncthing#5607) (syncthing#9067)
  gui: Fix lastSeenDays error due to undefined deviceStats when adding new devices (ref syncthing#8730) (syncthing#9066)
  gui: Automatically select device ID on click (ref syncthing#8544) (syncthing#9065)
  gui: Prevent modifications when saving changes (fixes syncthing#9019) (syncthing#9063)
  gui: Show in GUI if limitBandwidthInLan is enabled (syncthing#9062)
  lib/upgrade: Enable HTTP/2 for upgrade checks (syncthing#9060)
  lib/discover: Enable HTTP/2 for global discovery requests (syncthing#9059)
  cmd/stdiscosrv: Streamline context handling
  cmd/stdiscosrv: Explicitly enable HTTP/2
  gui, man, authors: Update docs, translations, and contributors
  cmd/stdiscosrv: Separate HTTPS and replication certificates
  cmd/stdiscosrv: Use larger database settings
  cmd/stdiscosrv: Modernise TLS settings, remove excessive HTTP logging
  cmd/stdiscosrv: Serve compressed responses
  lib/connections: Allow IPv6 ULA in discovery announcements (fixes syncthing#7456) (syncthing#9048)
  lib/beacon: Check FlagRunning (syncthing#9051)
  all: Remove lib/util package (syncthing#9049)
  lib/model: Clean up index handler life cycle (fixes syncthing#9021) (syncthing#9038)
  lib/osutil, lib/upnp: Check FlagRunning (fixes syncthing#8767) (syncthing#9047)
  ...
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.

Announce IPv6 ULA
2 participants