Commit 900025db authored by Andrei Vagin's avatar Andrei Vagin

net: save all attributes of sit devices

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: 4a044e6a ("net: Dump regular sit device")
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 33c58d94
...@@ -705,8 +705,7 @@ static int dump_sit(NetDeviceEntry *nde, struct cr_imgset *imgset, struct nlattr ...@@ -705,8 +705,7 @@ static int dump_sit(NetDeviceEntry *nde, struct cr_imgset *imgset, struct nlattr
#define ENCODE_ENTRY(__type, __ifla, __proto) do { \ #define ENCODE_ENTRY(__type, __ifla, __proto) do { \
if (data[__ifla]) { \ if (data[__ifla]) { \
se.__proto = *(__type *)nla_data(data[__ifla]); \ se.__proto = *(__type *)nla_data(data[__ifla]); \
if (se.__proto) \ se.has_##__proto = true; \
se.has_##__proto = true; \
} \ } \
} while (0) } while (0)
......
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