You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale-android/libtailscale/ifaceparse
kari-ts 94f2829e7c
android: fix local endpoint parsing and add regression ifaceparse_test (#728)
Android reports interface addresses in CIDR form. Recent changes
(see 9c933a08a2 (diff-1d627686c31972e04ef60d7d301e8a2a93714c60096a50055a6bbe9aa041ca8fL105),  9c933a08a2 (diff-1d627686c31972e04ef60d7d301e8a2a93714c60096a50055a6bbe9aa041ca8fL105)) parsed addresses as CIDR prefixes, resulting in prefix base being advertised as a local endpoint.
This change:
-instead of parsing CIDR prefixes, the parser strips the /NN portion and uses netip.ParseAddr to parse the host IP only
-extracts the interface parsing into a helper in a new package to make it testable on non-Android platforms
-adds a unit test to verify that host addresses are present and prefix-base ones are not

Fixes tailscale/tailscale#16836

Signed-off-by: kari-ts <kari@tailscale.com>
6 days ago
..
ifaceparse.go android: fix local endpoint parsing and add regression ifaceparse_test (#728) 6 days ago
ifaceparse_test.go android: fix local endpoint parsing and add regression ifaceparse_test (#728) 6 days ago