[RFCLAT#9] refactor getinterface_ip() to stop using libnl
The interface address query doesn't use libnl anymore.
Needed for reducing the library dependency. Once the last libnl user
del_anycast_address() is removed, clatd can remove libnl. Less
dependency helps moving clatd to mainline.
parse_ifaddrmsg() is used to replaced with getaddr_cb() which updates
struct target variable until walking through all messages.
parse_ifaddrmsg() keeps the same behavior as getaddr_cb().
Bug: 212345928
Test: atest clatd_test and manual test
1. Connect to ipv6-only wifi.
2. Try IPv4 traffic.
$ ping 8.8.8.8
Change-Id: I56591ec851d3202e18cce9fce3995d658d9f07e2
diff --git a/getaddr.h b/getaddr.h
index 5718e62..482ac13 100644
--- a/getaddr.h
+++ b/getaddr.h
@@ -18,6 +18,8 @@
#ifndef __GETADDR_H__
#define __GETADDR_H__
+#include <netinet/in.h>
+
union anyip {
struct in6_addr ip6;
struct in_addr ip4;