Closed YanceyChiew closed 2 years ago
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.
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
orIpFilter
might be more idiomatic field names. Also note there's no enclosing parentheses forif
conditions in Go, and to rungo fmt
on this.
Thanks for the pointers, I'll fix them.
Good luck!
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.