[v2,10/15] zdtm/net/ipv4: rename devconfs4 and rand_limit4 and dir4

Submitted by Pavel Tikhomirov on April 20, 2016, 2:42 p.m.

Details

Message ID 1461163376-32668-11-git-send-email-ptikhomirov@virtuozzo.com
State Accepted
Series "net/ipv6: c/r dev/default/all conf ops"
Commit ed7953dc34a4d93809ad9017f90b3795ba3cf00e
Headers show

Commit Message

Pavel Tikhomirov April 20, 2016, 2:42 p.m.
https://jira.sw.ru/browse/PSBM-30942
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 test/zdtm/static/netns-dev.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

Patch hide | download patch | download mbox

diff --git a/test/zdtm/static/netns-dev.c b/test/zdtm/static/netns-dev.c
index 9d1d5b7..5a34358 100644
--- a/test/zdtm/static/netns-dev.c
+++ b/test/zdtm/static/netns-dev.c
@@ -7,7 +7,7 @@ 
 #define LO_CONF_DIR_PATH "/proc/sys/net/ipv4/conf/lo"
 #define DEF_CONF_DIR_PATH "/proc/sys/net/ipv4/conf/default"
 
-char *devconfs[] = {
+char *devconfs4[] = {
 	"accept_local",
 	"accept_redirects",
 	"accept_source_route",
@@ -42,7 +42,7 @@  char *devconfs[] = {
 	NULL,
 };
 
-int rand_limit[] = {
+int rand_limit4[] = {
 	2,	/* accept_local */
 	2,	/* accept_redirects */
 	2,	/* accept_source_route */
@@ -77,9 +77,9 @@  int rand_limit[] = {
 };
 
 struct test_conf {
-	int ipv4_conf[ARRAY_SIZE(devconfs)];
-	int ipv4_conf_rand[ARRAY_SIZE(devconfs)];
-	char *dir;
+	int ipv4_conf[ARRAY_SIZE(devconfs4)];
+	int ipv4_conf_rand[ARRAY_SIZE(devconfs4)];
+	char *dir4;
 } lo, def;
 
 static int save_and_set(int opt, FILE *fp, struct test_conf *tc) {
@@ -106,8 +106,8 @@  static int save_and_set(int opt, FILE *fp, struct test_conf *tc) {
 	 */
 	val = (int)lrand48();
 
-	if (rand_limit[opt] != 0)
-		tc->ipv4_conf_rand[opt] = val % rand_limit[opt];
+	if (rand_limit4[opt] != 0)
+		tc->ipv4_conf_rand[opt] = val % rand_limit4[opt];
 	else
 		tc->ipv4_conf_rand[opt] = val;
 
@@ -135,7 +135,7 @@  static int check_and_restore(int opt, FILE *fp, struct test_conf *tc) {
 
 	if (val != tc->ipv4_conf_rand[opt]) {
 		fail("Option \"%s/%s\" changed from %d to %d",
-		     tc->dir, devconfs[opt], tc->ipv4_conf_rand[opt], val);
+		     tc->dir, devconfs4[opt], tc->ipv4_conf_rand[opt], val);
 		return -1;
 	}
 
@@ -161,11 +161,11 @@  static int for_each_option_do(int (*f)(int opt, FILE *fp, struct test_conf *tc),
 	int ret;
 	int i;
 
-	for (i = 0; devconfs[i]; i++) {
+	for (i = 0; devconfs4[i]; i++) {
 		FILE *fp;
 		char path[PATH_MAX];
 
-		ret = snprintf(path, sizeof(path), "%s/%s", tc->dir, devconfs[i]);
+		ret = snprintf(path, sizeof(path), "%s/%s", tc->dir4, devconfs4[i]);
 		if (ret < 0) {
 			pr_perror("snprintf");
 			return -1;
@@ -195,8 +195,8 @@  int main(int argc, char **argv)
 {
 	int ret;
 
-	lo.dir = LO_CONF_DIR_PATH;
-	def.dir = DEF_CONF_DIR_PATH;
+	lo.dir4 = LO_CONF_DIR_PATH;
+	def.dir4 = DEF_CONF_DIR_PATH;
 
 	test_init(argc, argv);
 

Comments

Pavel Emelianov April 21, 2016, 2:18 p.m.
Applied