Commit e72ccc1d authored by Pavel Tikhomirov's avatar Pavel Tikhomirov Committed by Pavel Emelyanov

zdtm: reset file position to the begginning of the file in netns-dev

writing to netdev configuration at non zero offset won't be supported:

```
[  301.431638] netns-dev wrote to accept_local when file position was
not 0! This will not be supported in the future. To silence this
warning, set kernel.sysctl_writes_strict = -1
```

v2: fix compilation

Sorry, please don't consider v1.
Signed-off-by: 's avatarPavel Tikhomirov <ptikhomirov@odin.com>
Acked-by: 's avatarAndrew Vagin <avagin@odin.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 28b88310
......@@ -91,6 +91,12 @@ static int save_and_set(int opt, FILE *fp, struct test_conf *tc) {
return -1;
}
ret = fseek(fp, 0, SEEK_SET);
if (ret) {
err("fseek");
return -1;
}
/*
* Set random value
*/
......@@ -129,6 +135,12 @@ static int check_and_restore(int opt, FILE *fp, struct test_conf *tc) {
return -1;
}
ret = fseek(fp, 0, SEEK_SET);
if (ret) {
err("fseek");
return -1;
}
/*
* Restore opt
*/
......
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