[CRIU] [PATCH CRIU 09/14] zdtm/net/ipv4: rename devconfs4 and rand_limit4 and dir4
Pavel Tikhomirov
ptikhomirov at virtuozzo.com
Wed Mar 30 03:42:27 PDT 2016
https://jira.sw.ru/browse/PSBM-30942
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
test/zdtm/static/netns-dev.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
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);
--
1.9.3
More information about the CRIU
mailing list