[v8,11/15] zdtm/net/ipv6: allow inacurate match for mldvX_unsolicited_report_interval

Submitted by Pavel Tikhomirov on April 28, 2016, 4:38 p.m.

Details

Message ID 1461861543-10463-12-git-send-email-ptikhomirov@virtuozzo.com
State Accepted
Series "net/ipv6: c/r dev/default/all conf ops"
Commit b7a218cba769af54fb9fb7f90aee1338f3b94028
Headers show

Commit Message

Pavel Tikhomirov April 28, 2016, 4:38 p.m.
mldv1_unsolicited_report_interval and mldv2_unsolicited_report_interval
are rounded up to (MSEC_PER_SEC / HZ)*k when set as in kernel they are
saved in jiffies. As min HZ is 100, 10 is MAX_MSEC_GRANULARITY.

https://jira.sw.ru/browse/PSBM-30942

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 test/zdtm/static/netns-dev.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch hide | download patch | download mbox

diff --git a/test/zdtm/static/netns-dev.c b/test/zdtm/static/netns-dev.c
index 3f909e6..2196f01 100644
--- a/test/zdtm/static/netns-dev.c
+++ b/test/zdtm/static/netns-dev.c
@@ -146,6 +146,8 @@  static int gen_conf(FILE *fp, int *conf, int *conf_rand,
 	return 0;
 }
 
+#define MAX_MSEC_GRANULARITY 10
+
 static int check_conf(FILE *fp, int *conf, int *conf_rand,
 		struct range *range, char *path) {
 	int ret;
@@ -163,6 +165,10 @@  static int check_conf(FILE *fp, int *conf, int *conf_rand,
 	if (val != *conf_rand) {
 		fail("Option \"%s\" changed from %d to %d",
 		     path, *conf_rand, val);
+		if ((strstr(path, "mldv1_unsolicited_report_interval")
+		     || strstr(path, "mldv2_unsolicited_report_interval"))
+		    && val - *conf_rand < MAX_MSEC_GRANULARITY)
+			return 0;
 		return -1;
 	}