aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Maltsev <pavelm@google.com>2018-06-07 13:16:35 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-06-07 13:16:35 -0700
commiteaa576093382fca94fa165b8c2c08cfa8258461c (patch)
tree9c7cecd5455ecd627ae095afe3274e416a96e83a
parent53b5acc4c46e0b4a8fb2a437a152e0e798b302ae (diff)
parentf72b896afbb5937c16d680da92723401b69de834 (diff)
downloadplatform_external_iproute2-eaa576093382fca94fa165b8c2c08cfa8258461c.tar.gz
platform_external_iproute2-eaa576093382fca94fa165b8c2c08cfa8258461c.tar.bz2
platform_external_iproute2-eaa576093382fca94fa165b8c2c08cfa8258461c.zip
Merge changes I16e45b38,I150ade94 am: f887894039
am: f72b896afb Change-Id: I765a7ba2a07db6587d0b2439e275131917eb5e2a
-rw-r--r--Android.mk2
-rw-r--r--Makefile6
-rw-r--r--include/namespace.h5
-rw-r--r--ip/Android.mk1
-rw-r--r--lib/Android.mk1
5 files changed, 14 insertions, 1 deletions
diff --git a/Android.mk b/Android.mk
index 9271768b..962bdcea 100644
--- a/Android.mk
+++ b/Android.mk
@@ -2,4 +2,6 @@
# vendor copies of the UAPI includes that are too old for us to build.
UAPI_INCLUDES := bionic/libc/kernel/uapi
+NETNS_RUN_DIR ?= /mnt/run
+
include $(call all-subdir-makefiles)
diff --git a/Makefile b/Makefile
index 6ad96104..b890758d 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,8 @@ PREFIX?=/usr
LIBDIR?=$(PREFIX)/lib
SBINDIR?=/sbin
CONFDIR?=/etc/iproute2
+NETNS_RUN_DIR?=/var/run/netns
+NETNS_ETC_DIR?=/etc/netns
DATADIR?=$(PREFIX)/share
HDRDIR?=$(PREFIX)/include/iproute2
DOCDIR?=$(DATADIR)/doc/iproute2
@@ -26,7 +28,9 @@ ifneq ($(SHARED_LIBS),y)
DEFINES+= -DNO_SHARED_LIBS
endif
-DEFINES+=-DCONFDIR=\"$(CONFDIR)\"
+DEFINES+=-DCONFDIR=\"$(CONFDIR)\" \
+ -DNETNS_RUN_DIR=\"$(NETNS_RUN_DIR)\" \
+ -DNETNS_ETC_DIR=\"$(NETNS_ETC_DIR)\"
#options for decnet
ADDLIB+=dnet_ntop.o dnet_pton.o
diff --git a/include/namespace.h b/include/namespace.h
index 51324b21..183f4612 100644
--- a/include/namespace.h
+++ b/include/namespace.h
@@ -7,8 +7,13 @@
#include <sys/syscall.h>
#include <errno.h>
+#ifndef NETNS_RUN_DIR
#define NETNS_RUN_DIR "/var/run/netns"
+#endif
+
+#ifndef NETNS_ETC_DIR
#define NETNS_ETC_DIR "/etc/netns"
+#endif
#ifndef CLONE_NEWNET
#define CLONE_NEWNET 0x40000000 /* New network namespace (lo, device, names sockets, etc) */
diff --git a/ip/Android.mk b/ip/Android.mk
index 179611fe..23ffbfdd 100644
--- a/ip/Android.mk
+++ b/ip/Android.mk
@@ -32,6 +32,7 @@ LOCAL_CFLAGS := \
-Wno-unused-parameter \
-Werror \
-D_GNU_SOURCE \
+ -DNETNS_RUN_DIR=\"$(NETNS_RUN_DIR)\" \
-DHAVE_SETNS \
LOCAL_LDFLAGS := -Wl,-export-dynamic -Wl,--no-gc-sections
diff --git a/lib/Android.mk b/lib/Android.mk
index 424b7fdc..e1bd3fec 100644
--- a/lib/Android.mk
+++ b/lib/Android.mk
@@ -11,6 +11,7 @@ LOCAL_SYSTEM_SHARED_LIBRARIES := libc
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include $(UAPI_INCLUDES)
LOCAL_CFLAGS := -O2 -g -W -Wall \
-DCONFDIR=\"/data/misc/net\" \
+ -DNETNS_RUN_DIR=\"$(NETNS_RUN_DIR)\" \
-DHAVE_UNISTD_H \
-DHAVE_ERRNO_H \
-DHAVE_NETINET_IN_H \