diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2017-11-17 17:30:49 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2017-11-22 00:27:21 +0900 |
commit | 7f7a7110ec387ccb6f0edbdd6956dee8dc649a87 (patch) | |
tree | d72d50b092c89ed4197e5583e9f82361b4546c54 | |
parent | 1c4b05b06ab25573b4e3eccda5c2a2b33dcbe3c0 (diff) | |
download | platform_external_iproute2-7f7a7110ec387ccb6f0edbdd6956dee8dc649a87.tar.gz platform_external_iproute2-7f7a7110ec387ccb6f0edbdd6956dee8dc649a87.tar.bz2 platform_external_iproute2-7f7a7110ec387ccb6f0edbdd6956dee8dc649a87.zip |
Adjust iproute2 v4.14 to compile on android
1. Update the list of files to compile.
2. Add -Wno-int-conversion to avoid compile error.
3. #ifdef out the call to getpass, which bionic does not support.
4. #ifdef out the #warning that says that libmnl is not present,
since android does not include it.
5. Fix a sizeof printf format specifier from %lu to %zu. This is
not being sent upstream because upstream code has since
changed.
Test: aosp_walleye-eng builds
Test: basic iproute operations (listing rules/routes, configuring addresses) work
Change-Id: I117dcabdf1396d1607167ed36991b2999804de47
-rw-r--r-- | ip/Android.mk | 4 | ||||
-rw-r--r-- | ip/iplink.c | 2 | ||||
-rw-r--r-- | ip/ipseg6.c | 2 | ||||
-rw-r--r-- | lib/Android.mk | 3 | ||||
-rw-r--r-- | lib/libnetlink.c | 2 |
5 files changed, 10 insertions, 3 deletions
diff --git a/ip/Android.mk b/ip/Android.mk index 5c45bc76..aa1242cf 100644 --- a/ip/Android.mk +++ b/ip/Android.mk @@ -8,7 +8,8 @@ LOCAL_SRC_FILES := ip.c ipaddress.c ipaddrlabel.c iproute.c iprule.c ipnetns.c \ iplink_vlan.c link_veth.c link_gre.c iplink_can.c \ iplink_macvlan.c ipl2tp.c \ ipfou.c iptoken.c tcp_metrics.c ipnetconf.c \ - iproute_lwtunnel.c + iproute_lwtunnel.c iplink_xdp.c iplink_vrf.c iplink_xstats.c \ + ipila.c ipmacsec.c ipseg6.c ipvrf.c LOCAL_MODULE := ip @@ -24,6 +25,7 @@ LOCAL_CFLAGS := \ -O2 -g \ -W -Wall \ -Wno-implicit-function-declaration \ + -Wno-int-conversion \ -Wno-missing-field-initializers \ -Wno-pointer-arith \ -Wno-sign-compare \ diff --git a/ip/iplink.c b/ip/iplink.c index 6a96ea9f..e4b81b54 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -1034,7 +1034,7 @@ int iplink_get(unsigned int flags, char *name, __u32 filt_mask) if (rtnl_talk(&rth, &req.n, &answer.n, sizeof(answer)) < 0) return -2; if (answer.n.nlmsg_len > sizeof(answer.buf)) { - fprintf(stderr, "Message truncated from %u to %lu\n", + fprintf(stderr, "Message truncated from %u to %zu\n", answer.n.nlmsg_len, sizeof(answer.buf)); return -2; } diff --git a/ip/ipseg6.c b/ip/ipseg6.c index a8f5c691..db60b349 100644 --- a/ip/ipseg6.c +++ b/ip/ipseg6.c @@ -213,7 +213,9 @@ int do_seg6(int argc, char **argv) invarg("hmac ALGO value is invalid", *argv); } opts.cmd = SEG6_CMD_SETHMAC; +#ifndef __BIONIC__ opts.pass = getpass(HMAC_KEY_PROMPT); +#endif } else { invarg("unknown", *argv); } diff --git a/lib/Android.mk b/lib/Android.mk index 3fa5a5ee..d7a8c5f6 100644 --- a/lib/Android.mk +++ b/lib/Android.mk @@ -3,7 +3,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES := \ color.c utils.c rt_names.c ll_types.c ll_proto.c ll_addr.c inet_proto.c \ - mpls_pton.c namespace.c names.c libgenl.c libnetlink.c + mpls_pton.c namespace.c names.c libgenl.c libnetlink.c bpf.c exec.c fs.c \ + json_print.c json_writer.c LOCAL_MODULE := libiprouteutil LOCAL_SYSTEM_SHARED_LIBRARIES := libc LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include diff --git a/lib/libnetlink.c b/lib/libnetlink.c index be7ac865..5b5c73e8 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c @@ -115,7 +115,9 @@ static int nl_dump_ext_err(const struct nlmsghdr *nlh, nl_ext_ack_fn_t errfn) return 0; } #else +#ifndef ANDROID #warning "libmnl required for error support" +#endif /* No extended error ack without libmnl */ static int nl_dump_ext_err(const struct nlmsghdr *nlh, nl_ext_ack_fn_t errfn) |