2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

19 Commits

Author SHA1 Message Date
Pengda Yang
810f52e443 limit the field width of 'scanf'
Fixes: #2121

Signed-off-by: Pengda Yang <daz-3ux@proton.me>
2024-10-26 22:17:07 -07:00
Pavel Tikhomirov
26db7adbbb clang-format: do automatic comment fixups
Result of `make indent` after enabling AlignTrailingComments.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2022-04-28 17:53:52 -07:00
Adrian Reber
93dd984ca0 Run 'make indent' on all C files
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Adrian Reber <areber@redhat.com>
2021-09-03 10:31:00 -07:00
Radostin Stoyanov
2e9490f1c2 Remove unused #include <dirent.h>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
7678f440ca test/zdtm: a few fixes to compile tests on Alpine
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:44 +03:00
Pavel Tikhomirov
d7f9e824d3 zdtm/net/sysctl: add all to test and fix order
1. First save/check all,default,lo together and only after - set them,
as setting some sysctls can affect the others
2. Set "accept_redirects" after "forwarding" both for ipv4 and ipv6
3. Change order to "all", "default", "lo"

*One can not set ipv6.conf.all.stable_secret, so don't even try, see:
commit 622c81d57b39 ("ipv6: generation of stable privacy addresses for
link-local and autoconf")

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-28 13:12:26 +03:00
Pavel Tikhomirov
3bc62b36a5 zdtm/netns-dev: fix misprint in hop_limit interval it should be {1, 255}
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-06-01 14:52:22 +03:00
Andrew Vagin
d10768719b zdtm/netns-dev: restrict hop_limit sysctl setting to range [1;255]
$ git log v4.4-rc1-465-gd6df198
commit d6df198d924775e4751561cf60ef0294e95f74df
Author: Phil Sutter <phil@nwl.cc>
Date:   Tue Dec 1 22:45:15 2015 +0100

    net: ipv6: restrict hop_limit sysctl setting to range [1; 255]

    Setting a value bigger than 255 resulted in using only the lower eight
    bits of that value as it is assigned to the u8 header field. To avoid
    this unexpected result, reject such values.

https://github.com/xemul/criu/issues/164
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:47:33 +03:00
Pavel Tikhomirov
52bccb262c zdtm/net/ipv6: add test for string stable_secret
stable_secret is always unset in new netns, and we can not restore
it to that state after it is set, so just skip save/restore steps

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Reviewed-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:32:05 +03:00
Pavel Tikhomirov
c4db738652 zdtm/net/ipv6: add test for confs
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Reviewed-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:32:05 +03:00
Pavel Tikhomirov
19f5a31396 zdtm/net/ipv6: add devconfs6 and rand_range6
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Reviewed-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:32:05 +03:00
Pavel Tikhomirov
5c79347327 zdtm/net/ipv6: allow inacurate match for mldvX_unsolicited_report_interval
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.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Reviewed-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:32:05 +03:00
Pavel Tikhomirov
cde72cabbd zdtm/net/ipv4: split save_and_set and check_and_restore
As changing disable_ipv6 sysctl for some device may change mtu sysctl
for it we need to first check mtu, and only then set disable_ipv6.
That can be done splitting our functions into two.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Reviewed-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:32:05 +03:00
Pavel Tikhomirov
701faddc84 zdtm/net/ipv4: replace rand limits with rand ranges
some sysctls have minimal value != 0 so we will also need to
set their lower limit e.g. /proc/sys/net/ipv6/conf/all/mtu

name                    possible states         range

accept_source_route     "<0", ">=0"             {-1, 0}
medium_id               "-1", "0", ">0"         {-1, INT_MAX}
src_valid_mark          true, false             {0, 1}
tag                     any                     {INT_MIN, INT_MAX}

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Reviewed-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:32:05 +03:00
Pavel Tikhomirov
bd5c7a4b9a zdtm/net/ipv4: make save_and_set and check_and_restore reusable
Get arrays out of save_and_set and check_and_restore, as it is an
overkill to give to the function wich should work with only one
element of array the whole array.

These makes them reusable in future test of ipv6 config.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Reviewed-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:32:05 +03:00
Andrew Vagin
7a2068e374 zdtm: fix compilation of netns-dev
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-04-27 14:11:03 +03:00
Pavel Tikhomirov
0d8289d852 zdtm/net/ipv4: rename devconfs4 and rand_limit4 and dir4
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-04-27 14:11:03 +03:00
Pavel Tikhomirov
ae682757fd net/ipv4: add new sysctls
drop_unicast_in_l2_multicast and drop_gratuitous_arp appeared in MS:

commit 12b74dfadb5a ("ipv4: add option to drop unicast encapsulated in
L2 multicast")
commit 97daf3314550 ("ipv4: add option to drop gratuitous ARP packets")

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-04-27 14:11:03 +03:00
Pavel Emelyanov
2e13f1f029 test: Get rid of live directory
Move static and transition into zdtm top. We can't move all the micro
tests themselves, as we need to distinguish static from non static (zdtm.py
makes additional checks on static ones).

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-20 13:40:52 +03:00