Closed rozhuk-im closed 3 years ago
Having just discovered that it would be extremely difficult to bundle network-manager in our flatpak version, I'm interested in removing it. I also had assumed it was available anywhere other standard gnome libraries were.
It was recently added because I was more comfortable using it for network interface selection and monitoring online state than using python modules. We track the online state so we can notify the user if they can connect or not, and let them know there's an issue in the ui. This has to remain in one form or another - it can't be removed. I also don't want to remove the descriptive network interface names in the preferences ui.
Previous versions had native networking (removed mostly here: 6617f3581248595, and I'd probably work some of that back in to remove network-manager.
It is not clear to me: what is "online" in context of app that works only on local area net (LAN)? If OS have IP address on selected network adapter than it can communicate = online. It can be easy discovered via netifases python lib.
Descriptive network interface names not so important feature as portability to other OS, it will be nice if it can work or at least not break app on other OS.
Another thing that I did not understand: why app can not use multiple network intefaces in same time? It can enum all, start zeroconf on each net if, same time listen on 0.0.0.0 or per net if addrs.
And IPv6 support - time to drop IPv4, new app in 2020 must support IPv6 from start.
Small off-top: security can be increased if app limit TTL on sockets - no one outside LAN can connect to it: TTL=1 - first router will drop packet instead of forward it.
For unicast sockets:
int ttl = 1; /* max = 255 */
setsockopt(s, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl));
This for multicast:
u_char ttl = 1; /* range: 0 to 255, default = 1 */
setsockopt(s, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl));
Same for IPv6: IPPROTO_IPV6 + IPV6_UNICAST_HOPS, IPV6_MULTICAST_HOPS.
network-manager removed here: https://github.com/linuxmint/warpinator/commit/90efc187a97dc6dac6176787bf2fbb8f059bc336
We can add real ipv6 support eventually - it's still relatively immature in python zeroconf, and multiple interfaces is already planned, maybe for the next release.
With these changes it run and works on FreeBSD.
I see no reasons why this app try to detect that it is "online" and why it was implemented. Hope that app will more user friendly for non Linux users in future.