Fil writes: > Joonas Kylmälä wrote: > [...] >> I also thought about making a list of valid IP addresses, i.e., site >> local addresses + public ip addresses but how do we know what is public >> ip address? The java.net.InetAddress class didn't have any methods for >> that so implementing it in this way doesn't sound very promising. >> >> What are your thoughts on this? > Well, I guess an IP address is considered to be public if it doesn't > fall in any reserved range. > That is, basically, if it's not link-local nor site-local, nor is it > localhost, then it could be considered public (I think we can safely > ignore other reserved ranges). > > In this respect, I guess the condition could simply be reversed to be: > if (a.getHostAddress() != null && ! a.isLinkLocalAddress()) > > Checking for a loopback address on a WLAN interface is overkill IMHO. > The only thing that really matters in this case is to filter out > link-local addresses, which have a non-negligible chance to be assinged > to the interface.
The reverse tether script checks if a gateway address is available and if that's the case, it assumes that the network is configured. Didn't you do the same in the first version of the patch? Did you drop that solution because there was no method for it available or what was the reason? Wouldn't it be possible to e.g. read the property dhcp.wlan0.gateway and check if it's empty or not? Would this be a more general solution that covers these corner cases? Or does your above solution already solve the issue? I think it's a lot more important that there are no false positives because I could imagine that some apps won't handle this graciously. Best regards, Wolfgang > That said, I'm willing to make that change in my patch. > But I'd like to have feedback from the maintainers before proceeding. > Just in case anything else needs to be addressed. > Above all, I'd like to first be sure my patch can be accepted and > merged, before doing any other work on it. > > For now, thanks for your suggestions. > > Regards, > > Fil > > > > _______________________________________________ > Replicant mailing list > [email protected] > https://lists.osuosl.org/mailman/listinfo/replicant -- Website: https://fossencdi.org OpenPGP: 0F30 D1A0 2F73 F70A 6FEE 048E 5816 A24C 1075 7FC4 Key download: https://wiedmeyer.de/keys/ww.asc
signature.asc
Description: PGP signature
_______________________________________________ Replicant mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/replicant
