FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: option to limit local announcements (fixes #10195) by legacylynx · Pull Request #10802 · syncthing/syncthing · GitHub

feat: option to limit local announcements (fixes #10195) - #10802

Open
legacylynx wants to merge 3 commits into
syncthing:mainfrom
legacylynx:feat/limit-local-announcements
Open

feat: option to limit local announcements (fixes #10195)#10802
legacylynx wants to merge 3 commits into
syncthing:mainfrom
legacylynx:feat/limit-local-announcements

Conversation

Copy link
Copy Markdown

Purpose

Currently, there is no way to prevent local announcements from being broadcast/multicast on the specific interfaces.
Syncthing sends the announcements on all running broadcast/multicast-capable (and, in case of Android, non-cellular) interfaces, which may be undesirable.
The proposed change should eliminate that traffic, which is noise, especially in a conservatively configured firewall scenario.
This change allows to set a whitelist or blacklist of network interfaces that will (not) send announcements. If both lists are specified, whitelist takes precedence. It is possible to use globs in network interfaces names, e.g. eth* will match eth0, eth1, etc, or enp*s[0-9] will match enp34s0, enp2s1, etc.

Testing

Updated tests for the configuration in accordance with the new directives.
Updated tests for LocalInstanceID according to the new arguments of the NewLocal function.
I'm not sure if it's possible to check the rest using automated tests.

If we talk about manual checks directly using the Syncthing, then the logs of interest are shown with the STTRACE=beacon,discover,config environment variable - which interfaces are ignored, which broadcast addresses are added as a result and what happens when the configuration is commited.
And as an another option, we can check the fact of a broadcast using firewall logs (for example, with log prefix "NFT LOG " rules in nftables chains) or a traffic analyzer.

Screenshots

Documentation

At the moment, help for new fields has been added to the GUI, as you can see in the screenshot 1 2.
But I guess it's better to be in the documentation, right?
There is no PR in the docs repository yet.

Authorship

legacylynx 254520357+legacylynx@users.noreply.github.com

See issue syncthing#10195
Currently, there is no way to prevent local announcements from being
broadcast/multicast on the specific interfaces. Syncthing sends the
announcements on all running broadcast/multicast-capable (and, in case
of Android, non-cellular) interfaces, which may be undesirable.
The proposed change should eliminate that traffic, which is noise,
especially in a conservatively configured firewall scenario.
This change allows to set a whitelist or blacklist of network interfaces
that will (not) send announcements. If both lists are specified,
whitelist takes precedence. It is possible to use globs in
network interfaces names, e.g. `eth*` will match `eth0`, `eth1`, etc, or
`enp*s[0-9]` will match `enp34s0`, `enp2s1`, etc.

Signed-off-by: legacylynx <254520357+legacylynx@users.noreply.github.com>
github-actions Bot added the enhancement New features or improvements of some kind, as opposed to a problem (bug) label Jul 16, 2026

calmh commented Jul 17, 2026

Copy link
Copy Markdown
Member

Sounds reasonable, though I'm not excited about passing around the globs and the slight duplication of matching logic. There's some precedent here in the XattrFilter. It seems like we could refactor that to break out the []XattrFilterEntry to a more generic item filter, and then use it for both the xattrs and your thing.

Copy link
Copy Markdown
Author

I'm not excited about passing around the globs and the slight duplication of matching logic

I agree. I just wasn't sure how to do it better, so I did... simpler?
Yes, it was hardly a good decision, actually.

It seems like we could refactor that to break out the []XattrFilterEntry to a more generic item filter, and then use it for both the xattrs and your thing.

Yes, it should be much better.
Will this change be in the mainstream soon? Or should I try to do it myself as part of this PR? I'm a little worried that I might break something else or do something strange, since, to be honest, I'm not very familiar with Golang and haven't contributed to such large projects before.

calmh removed the rep/suspect label Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New features or improvements of some kind, as opposed to a problem (bug)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL