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

Fix: update to more recent pnet network interface library and ignore routable IPs #24

Closed
wants to merge 2 commits into from

Conversation

gbusker
Copy link

@gbusker gbusker commented Feb 4, 2021

  • Current version fails on openwrt MIPS because if-addrs returns IP address in reverse order.
  • if-addrs is deprecated so replaced with pnet::datalink
  • Added rule to exclude any networks that are not private (10.* etc) when creating a response

@willstott101
Copy link
Contributor

  • I'm not sure I understand what you mean by this, could you elaborate? The order of each address is reversed, or the order of the list of addresses?
  • I can't find any suggestion that https://crates.io/crates/if-addrs is deprecated, and I've had a good experience getting patches merged for support of different distros in that project already. I've got nothing against pnet though so if it's really solving a problem that could be fine.
  • Is there a precedent for this in other mDNS implementations? I guess it kind of makes sense, but is there much of a downside to letting clients prioritise the addresses they use instead of hiding some?

@gbusker
Copy link
Author

gbusker commented Feb 15, 2021

  • I'm not sure I understand what you mean by this, could you elaborate? The order of each address is reversed, or the order of the list of addresses?

I believe this to be an issue with if-addrs on the MIPS platform.
I'll make some time to investigate this further later.

@ArcticLampyrid
Copy link

Added rule to exclude any networks that are not private (10.* etc) when creating a response

I don't think this is needed. However, it's good if we can allow the user to customize IPs

if-addrs is deprecated so replaced with pnet::datalink

if-addrs is not explicitly deprecated but actually inactive.
By the way, ip-addrs will get ip that belongs to down interface, but pnet has the func is_up

@willstott101
Copy link
Contributor

With the merge of #35 I don't think the is_private check is the right solution. Users can filter their IPs in their own way now. If you believe there is a bug in if-addrs on a particular platform please open an issue (or ideally, a pull request) in the upstream repo: https://github.com/messense/if-addrs

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.

3 participants