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

[feat](ssdp): Add ip filter callback holder #96

Merged
merged 2 commits into from
Jun 28, 2022

Conversation

YanceyChiew
Copy link
Contributor

Currently ssdp will announce all available ip addresses on the interface, which may not be what the dlna service actually wants.

The dlna service might not be listening on those addresses at all, which would mislead clients trying to establish a connection.

This commit allows to use a callback function to filter the ip addresses discovered by ssdp to decide whether to use.

Currently ssdp will announce all available ip addresses on the interface, which may not be what the dlna service actually wants.

The dlna service might not be listening on those addresses at all, which would mislead clients trying to establish a connection.

This commit allows to use a callback function to filter the ip addresses discovered by ssdp to decide whether to use.
@anacrolix
Copy link
Owner

Do you have your own project that makes use of the new field? IPFilter or IpFilter might be more idiomatic field names. Also note there's no enclosing parentheses for if conditions in Go, and to run go fmt on this.

@YanceyChiew
Copy link
Contributor Author

Do you have your own project that makes use of the new field?

No, I don't own such a project, but one of the software I'm using (ps. rclone) depends on anacrolix/dms. Since the announced ip may contain non-LAN addresses, it may be a security risk for DMS. If the DMS only listens on LAN addresses, some of the announced but not actually listened IPs may have a negative impact. After all, in this case, we can't expect all DMCs to be able to find an accessable IP from those announced by DMS.

So I want to make some improvements to the software mentioned above to allow ssdp to announce only those addresses that DMS listens on, but if I want to achieve such a function. I need the support of it's upstream anacrolix/dms first. Also, I think it might be a common need to filter out unwanted ip's from announcements.

IPFilter or IpFilter might be more idiomatic field names. Also note there's no enclosing parentheses for if conditions in Go, and to run go fmt on this.

Thanks for the pointers, I'll fix them.

- Modifiy new variable name to be more idiomatic.
- Fix code formatting issue.
@anacrolix anacrolix merged commit 092b7b4 into anacrolix:master Jun 28, 2022
@anacrolix
Copy link
Owner

Good luck!

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.

None yet

2 participants