Commit 0d8289d8 authored by Pavel Tikhomirov's avatar Pavel Tikhomirov Committed by Pavel Emelyanov

zdtm/net/ipv4: rename devconfs4 and rand_limit4 and dir4

Signed-off-by: 's avatarPavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent af851fdf
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#define LO_CONF_DIR_PATH "/proc/sys/net/ipv4/conf/lo" #define LO_CONF_DIR_PATH "/proc/sys/net/ipv4/conf/lo"
#define DEF_CONF_DIR_PATH "/proc/sys/net/ipv4/conf/default" #define DEF_CONF_DIR_PATH "/proc/sys/net/ipv4/conf/default"
char *devconfs[] = { char *devconfs4[] = {
"accept_local", "accept_local",
"accept_redirects", "accept_redirects",
"accept_source_route", "accept_source_route",
...@@ -42,7 +42,7 @@ char *devconfs[] = { ...@@ -42,7 +42,7 @@ char *devconfs[] = {
NULL, NULL,
}; };
int rand_limit[] = { int rand_limit4[] = {
2, /* accept_local */ 2, /* accept_local */
2, /* accept_redirects */ 2, /* accept_redirects */
2, /* accept_source_route */ 2, /* accept_source_route */
...@@ -77,9 +77,9 @@ int rand_limit[] = { ...@@ -77,9 +77,9 @@ int rand_limit[] = {
}; };
struct test_conf { struct test_conf {
int ipv4_conf[ARRAY_SIZE(devconfs)]; int ipv4_conf[ARRAY_SIZE(devconfs4)];
int ipv4_conf_rand[ARRAY_SIZE(devconfs)]; int ipv4_conf_rand[ARRAY_SIZE(devconfs4)];
char *dir; char *dir4;
} lo, def; } lo, def;
static int save_and_set(int opt, FILE *fp, struct test_conf *tc) { 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) { ...@@ -106,8 +106,8 @@ static int save_and_set(int opt, FILE *fp, struct test_conf *tc) {
*/ */
val = (int)lrand48(); val = (int)lrand48();
if (rand_limit[opt] != 0) if (rand_limit4[opt] != 0)
tc->ipv4_conf_rand[opt] = val % rand_limit[opt]; tc->ipv4_conf_rand[opt] = val % rand_limit4[opt];
else else
tc->ipv4_conf_rand[opt] = val; tc->ipv4_conf_rand[opt] = val;
...@@ -135,7 +135,7 @@ static int check_and_restore(int opt, FILE *fp, struct test_conf *tc) { ...@@ -135,7 +135,7 @@ static int check_and_restore(int opt, FILE *fp, struct test_conf *tc) {
if (val != tc->ipv4_conf_rand[opt]) { if (val != tc->ipv4_conf_rand[opt]) {
fail("Option \"%s/%s\" changed from %d to %d", 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; return -1;
} }
...@@ -161,11 +161,11 @@ static int for_each_option_do(int (*f)(int opt, FILE *fp, struct test_conf *tc), ...@@ -161,11 +161,11 @@ static int for_each_option_do(int (*f)(int opt, FILE *fp, struct test_conf *tc),
int ret; int ret;
int i; int i;
for (i = 0; devconfs[i]; i++) { for (i = 0; devconfs4[i]; i++) {
FILE *fp; FILE *fp;
char path[PATH_MAX]; 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) { if (ret < 0) {
pr_perror("snprintf"); pr_perror("snprintf");
return -1; return -1;
...@@ -195,8 +195,8 @@ int main(int argc, char **argv) ...@@ -195,8 +195,8 @@ int main(int argc, char **argv)
{ {
int ret; int ret;
lo.dir = LO_CONF_DIR_PATH; lo.dir4 = LO_CONF_DIR_PATH;
def.dir = DEF_CONF_DIR_PATH; def.dir4 = DEF_CONF_DIR_PATH;
test_init(argc, argv); test_init(argc, argv);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment