lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 19 Jul 2023 20:50:45 +0200
From: Gioele Barabucci <gioele@...rio.it>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>,
	Gioele Barabucci <gioele@...rio.it>
Subject: [iproute2 01/22] Makefile: Rename CONFDIR to CONF_ETC_DIR

Signed-off-by: Gioele Barabucci <gioele@...rio.it>
---
 Makefile                 |  8 ++++----
 include/utils.h          |  4 ++--
 lib/bpf_legacy.c         |  2 +-
 lib/rt_names.c           | 28 ++++++++++++++--------------
 man/man8/Makefile        |  2 +-
 man/man8/ip-address.8.in |  2 +-
 man/man8/ip-link.8.in    |  4 ++--
 man/man8/ip-route.8.in   | 18 +++++++++---------
 8 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/Makefile b/Makefile
index 8a17d614..54e5cde2 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ endif
 
 PREFIX?=/usr
 SBINDIR?=/sbin
-CONFDIR?=/etc/iproute2
+CONF_ETC_DIR?=/etc/iproute2
 NETNS_RUN_DIR?=/var/run/netns
 NETNS_ETC_DIR?=/etc/netns
 DATADIR?=$(PREFIX)/share
@@ -37,7 +37,7 @@ ifneq ($(SHARED_LIBS),y)
 DEFINES+= -DNO_SHARED_LIBS
 endif
 
-DEFINES+=-DCONFDIR=\"$(CONFDIR)\" \
+DEFINES+=-DCONF_ETC_DIR=\"$(CONF_ETC_DIR)\" \
          -DNETNS_RUN_DIR=\"$(NETNS_RUN_DIR)\" \
          -DNETNS_ETC_DIR=\"$(NETNS_ETC_DIR)\"
 
@@ -100,11 +100,11 @@ config.mk:
 
 install: all
 	install -m 0755 -d $(DESTDIR)$(SBINDIR)
-	install -m 0755 -d $(DESTDIR)$(CONFDIR)
+	install -m 0755 -d $(DESTDIR)$(CONF_ETC_DIR)
 	install -m 0755 -d $(DESTDIR)$(ARPDDIR)
 	install -m 0755 -d $(DESTDIR)$(HDRDIR)
 	@for i in $(SUBDIRS);  do $(MAKE) -C $$i install; done
-	install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR)
+	install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONF_ETC_DIR)
 	install -m 0755 -d $(DESTDIR)$(BASH_COMPDIR)
 	install -m 0644 bash-completion/tc $(DESTDIR)$(BASH_COMPDIR)
 	install -m 0644 bash-completion/devlink $(DESTDIR)$(BASH_COMPDIR)
diff --git a/include/utils.h b/include/utils.h
index 0b5d86a2..d3bf49bf 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -38,8 +38,8 @@ extern int numeric;
 extern bool do_all;
 extern int echo_request;
 
-#ifndef CONFDIR
-#define CONFDIR		"/etc/iproute2"
+#ifndef CONF_ETC_DIR
+#define CONF_ETC_DIR "/etc/iproute2"
 #endif
 
 #define SPRINT_BSIZE 64
diff --git a/lib/bpf_legacy.c b/lib/bpf_legacy.c
index 8ac64235..706820f5 100644
--- a/lib/bpf_legacy.c
+++ b/lib/bpf_legacy.c
@@ -2924,7 +2924,7 @@ static int bpf_elf_ctx_init(struct bpf_elf_ctx *ctx, const char *pathname,
 	}
 
 	bpf_save_finfo(ctx);
-	bpf_hash_init(ctx, CONFDIR "/bpf_pinning");
+	bpf_hash_init(ctx, CONF_ETC_DIR "/bpf_pinning");
 
 	return 0;
 out_free:
diff --git a/lib/rt_names.c b/lib/rt_names.c
index 68db74e3..0407b361 100644
--- a/lib/rt_names.c
+++ b/lib/rt_names.c
@@ -153,10 +153,10 @@ static void rtnl_rtprot_initialize(void)
 	DIR *d;
 
 	rtnl_rtprot_init = 1;
-	rtnl_tab_initialize(CONFDIR "/rt_protos",
+	rtnl_tab_initialize(CONF_ETC_DIR "/rt_protos",
 			    rtnl_rtprot_tab, 256);
 
-	d = opendir(CONFDIR "/rt_protos.d");
+	d = opendir(CONF_ETC_DIR "/rt_protos.d");
 	if (!d)
 		return;
 
@@ -174,7 +174,7 @@ static void rtnl_rtprot_initialize(void)
 		if (strcmp(de->d_name + len - 5, ".conf"))
 			continue;
 
-		snprintf(path, sizeof(path), CONFDIR "/rt_protos.d/%s",
+		snprintf(path, sizeof(path), CONF_ETC_DIR "/rt_protos.d/%s",
 			 de->d_name);
 		rtnl_tab_initialize(path, rtnl_rtprot_tab, 256);
 	}
@@ -240,7 +240,7 @@ static bool rtnl_addrprot_tab_initialized;
 
 static void rtnl_addrprot_initialize(void)
 {
-	rtnl_tab_initialize(CONFDIR "/rt_addrprotos",
+	rtnl_tab_initialize(CONF_ETC_DIR "/rt_addrprotos",
 			    rtnl_addrprot_tab,
 			    ARRAY_SIZE(rtnl_addrprot_tab));
 	rtnl_addrprot_tab_initialized = true;
@@ -297,7 +297,7 @@ static int rtnl_rtscope_init;
 static void rtnl_rtscope_initialize(void)
 {
 	rtnl_rtscope_init = 1;
-	rtnl_tab_initialize(CONFDIR "/rt_scopes",
+	rtnl_tab_initialize(CONF_ETC_DIR "/rt_scopes",
 			    rtnl_rtscope_tab, 256);
 }
 
@@ -362,7 +362,7 @@ static int rtnl_rtrealm_init;
 static void rtnl_rtrealm_initialize(void)
 {
 	rtnl_rtrealm_init = 1;
-	rtnl_tab_initialize(CONFDIR "/rt_realms",
+	rtnl_tab_initialize(CONF_ETC_DIR "/rt_realms",
 			    rtnl_rtrealm_tab, 256);
 }
 
@@ -439,10 +439,10 @@ static void rtnl_rttable_initialize(void)
 		if (rtnl_rttable_hash[i])
 			rtnl_rttable_hash[i]->id = i;
 	}
-	rtnl_hash_initialize(CONFDIR "/rt_tables",
+	rtnl_hash_initialize(CONF_ETC_DIR "/rt_tables",
 			     rtnl_rttable_hash, 256);
 
-	d = opendir(CONFDIR "/rt_tables.d");
+	d = opendir(CONF_ETC_DIR "/rt_tables.d");
 	if (!d)
 		return;
 
@@ -461,7 +461,7 @@ static void rtnl_rttable_initialize(void)
 			continue;
 
 		snprintf(path, sizeof(path),
-			 CONFDIR "/rt_tables.d/%s", de->d_name);
+			 CONF_ETC_DIR "/rt_tables.d/%s", de->d_name);
 		rtnl_hash_initialize(path, rtnl_rttable_hash, 256);
 	}
 	closedir(d);
@@ -527,7 +527,7 @@ static int rtnl_rtdsfield_init;
 static void rtnl_rtdsfield_initialize(void)
 {
 	rtnl_rtdsfield_init = 1;
-	rtnl_tab_initialize(CONFDIR "/rt_dsfield",
+	rtnl_tab_initialize(CONF_ETC_DIR "/rt_dsfield",
 			    rtnl_rtdsfield_tab, 256);
 }
 
@@ -606,7 +606,7 @@ static int rtnl_group_init;
 static void rtnl_group_initialize(void)
 {
 	rtnl_group_init = 1;
-	rtnl_hash_initialize(CONFDIR "/group",
+	rtnl_hash_initialize(CONF_ETC_DIR "/group",
 			     rtnl_group_hash, 256);
 }
 
@@ -696,7 +696,7 @@ static int nl_proto_init;
 static void nl_proto_initialize(void)
 {
 	nl_proto_init = 1;
-	rtnl_tab_initialize(CONFDIR "/nl_protos",
+	rtnl_tab_initialize(CONF_ETC_DIR "/nl_protos",
 			    nl_proto_tab, 256);
 }
 
@@ -762,7 +762,7 @@ static void protodown_reason_initialize(void)
 
 	protodown_reason_init = 1;
 
-	d = opendir(CONFDIR "/protodown_reasons.d");
+	d = opendir(CONF_ETC_DIR "/protodown_reasons.d");
 	if (!d)
 		return;
 
@@ -780,7 +780,7 @@ static void protodown_reason_initialize(void)
 		if (strcmp(de->d_name + len - 5, ".conf"))
 			continue;
 
-		snprintf(path, sizeof(path), CONFDIR "/protodown_reasons.d/%s",
+		snprintf(path, sizeof(path), CONF_ETC_DIR "/protodown_reasons.d/%s",
 			 de->d_name);
 		rtnl_tab_initialize(path, protodown_reason_tab,
 				    PROTODOWN_REASON_NUM_BITS);
diff --git a/man/man8/Makefile b/man/man8/Makefile
index b1fd87bd..ae5e37a5 100644
--- a/man/man8/Makefile
+++ b/man/man8/Makefile
@@ -9,7 +9,7 @@ all: $(TARGETS)
 	sed \
 		-e "s|@...NS_ETC_DIR@|$(NETNS_ETC_DIR)|g" \
 		-e "s|@...NS_RUN_DIR@|$(NETNS_RUN_DIR)|g" \
-		-e "s|@...CONFDIR@|$(CONFDIR)|g" \
+		-e "s|@...CONF_ETC_DIR@|$(CONF_ETC_DIR)|g" \
 		$< > $@
 
 distclean: clean
diff --git a/man/man8/ip-address.8.in b/man/man8/ip-address.8.in
index abdd6a20..a2df22d4 100644
--- a/man/man8/ip-address.8.in
+++ b/man/man8/ip-address.8.in
@@ -209,7 +209,7 @@ The maximum allowed total length of label is 15 characters.
 .BI scope " SCOPE_VALUE"
 the scope of the area where this address is valid.
 The available scopes are listed in file
-.BR "@SYSCONFDIR@..._scopes" .
+.BR "@SYSCONF_ETC_DIR@..._scopes" .
 Predefined scope values are:
 
 .in +8
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index 6a82ddc4..ac1a3b5f 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -2251,7 +2251,7 @@ give the device a symbolic name for easy reference.
 .BI group " GROUP"
 specify the group the device belongs to.
 The available groups are listed in file
-.BR "@SYSCONFDIR@...oup" .
+.BR "@SYSCONF_ETC_DIR@...oup" .
 
 .TP
 .BI vf " NUM"
@@ -2852,7 +2852,7 @@ specifies which help of link type to display.
 .SS
 .I GROUP
 may be a number or a string from the file
-.B @SYSCONFDIR@...oup
+.B @SYSCONF_ETC_DIR@...oup
 which can be manually filled.
 
 .SH "EXAMPLES"
diff --git a/man/man8/ip-route.8.in b/man/man8/ip-route.8.in
index c2b00833..9fc3f4a1 100644
--- a/man/man8/ip-route.8.in
+++ b/man/man8/ip-route.8.in
@@ -357,7 +357,7 @@ normal routing tables.
 .B Route tables:
 Linux-2.x can pack routes into several routing tables identified
 by a number in the range from 1 to 2^32-1 or by name from the file
-.B @SYSCONFDIR@..._tables
+.B @SYSCONF_ETC_DIR@..._tables
 By default all normal routes are inserted into the
 .B main
 table (ID 254) and the kernel only uses this table when calculating routes.
@@ -420,7 +420,7 @@ may still match a route with a zero TOS.
 .I TOS
 is either an 8 bit hexadecimal number or an identifier
 from
-.BR "@SYSCONFDIR@..._dsfield" .
+.BR "@SYSCONF_ETC_DIR@..._dsfield" .
 
 .TP
 .BI metric " NUMBER"
@@ -435,7 +435,7 @@ is an arbitrary 32bit number, where routes with lower values are preferred.
 the table to add this route to.
 .I TABLEID
 may be a number or a string from the file
-.BR "@SYSCONFDIR@..._tables" .
+.BR "@SYSCONF_ETC_DIR@..._tables" .
 If this parameter is omitted,
 .B ip
 assumes the
@@ -476,7 +476,7 @@ covered by the route prefix.
 the realm to which this route is assigned.
 .I REALMID
 may be a number or a string from the file
-.BR "@SYSCONFDIR@..._realms" .
+.BR "@SYSCONF_ETC_DIR@..._realms" .
 
 .TP
 .BI mtu " MTU"
@@ -627,7 +627,7 @@ command.
 the scope of the destinations covered by the route prefix.
 .I SCOPE_VAL
 may be a number or a string from the file
-.BR "@SYSCONFDIR@..._scopes" .
+.BR "@SYSCONF_ETC_DIR@..._scopes" .
 If this parameter is omitted,
 .B ip
 assumes scope
@@ -647,7 +647,7 @@ routes.
 the routing protocol identifier of this route.
 .I RTPROTO
 may be a number or a string from the file
-.BR "@SYSCONFDIR@..._protos" .
+.BR "@SYSCONF_ETC_DIR@..._protos" .
 If the routing protocol ID is not given,
 .B ip assumes protocol
 .B boot
@@ -880,7 +880,7 @@ matching packets are dropped.
 specified lookup table.
 .I TABLEID
 is either a number or a string from the file
-.BR "@SYSCONFDIR@..._tables" .
+.BR "@SYSCONF_ETC_DIR@..._tables" .
 If
 .B vrftable
 is used, the argument must be a VRF device associated with
@@ -896,7 +896,7 @@ and an inner IPv6 packet. Other matching packets are dropped.
 specified lookup table.
 .I TABLEID
 is either a number or a string from the file
-.BR "@SYSCONFDIR@..._tables" .
+.BR "@SYSCONF_ETC_DIR@..._tables" .
 The argument must be a VRF device associated with the table id.
 Moreover, the VRF table associated with the table id must be configured
 with the VRF strict mode turned on (net.vrf.strict_mode=1). This action
@@ -909,7 +909,7 @@ at all, and an inner IPv4 packet. Other matching packets are dropped.
 to the specified lookup table.
 .I TABLEID
 is either a number or a string from the file
-.BR "@SYSCONFDIR@..._tables" .
+.BR "@SYSCONF_ETC_DIR@..._tables" .
 The argument must be a VRF device associated with the table id.
 Moreover, the VRF table associated with the table id must be configured
 with the VRF strict mode turned on (net.vrf.strict_mode=1). This action
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ