net: save all attributes of sit devices

Submitted by Andrei Vagin on Feb. 26, 2018, 12:25 a.m.

Details

Message ID 20180226002509.11417-1-avagin@openvz.org
State Accepted
Series "net: save all attributes of sit devices"
Headers show

Commit Message

Andrei Vagin Feb. 26, 2018, 12:25 a.m.
[This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing]

From: Andrei Vagin <avagin@virtuozzo.com>

Currently we save only attributes with non-zero values. For example,
a default value for IFLA_IPTUN_PROTO is IPPROTO_IPV6 (41), so we have to
save even attributes with zero values.

https://github.com/checkpoint-restore/criu/issues/445

Fixes: 4a044e6af93f ("net: Dump regular sit device")
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 criu/net.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--
2.13.6

Patch hide | download patch | download mbox

diff --git a/criu/net.c b/criu/net.c
index dcaf93f88..1dfcdf3dc 100644
--- a/criu/net.c
+++ b/criu/net.c
@@ -682,8 +682,7 @@  static int dump_sit(NetDeviceEntry *nde, struct cr_imgset *imgset, struct nlattr
 #define ENCODE_ENTRY(__type, __ifla, __proto)  do {                    \
                if (data[__ifla]) {                                     \
                        se.__proto = *(__type *)nla_data(data[__ifla]); \
-                       if (se.__proto)                                 \
-                               se.has_##__proto = true;                \
+                       se.has_##__proto = true;                        \
                }                                                       \
        } while (0)