diff --git a/Makefile b/Makefile index b526d3b5..651d2a50 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,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 @@ -34,7 +36,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 aed7ce08..e47f9b5d 100644 --- a/include/namespace.h +++ b/include/namespace.h @@ -8,8 +8,13 @@ #include #include +#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) */