mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 13:58:34 +00:00
net: Declare and expand a struct with newlink request
We need to add payload to NEWLINK request and will have to work with it outside the restore_one_link fn. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
13
net.c
13
net.c
@@ -140,12 +140,15 @@ static int restore_link_cb(struct nlmsghdr *hdr, void *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int restore_one_link(NetDeviceEntry *nde, int nlsk)
|
||||
{
|
||||
struct {
|
||||
struct newlink_req {
|
||||
struct nlmsghdr h;
|
||||
struct ifinfomsg i;
|
||||
} req;
|
||||
char buf[1024];
|
||||
};
|
||||
|
||||
static int restore_one_link(NetDeviceEntry *nde, int nlsk)
|
||||
{
|
||||
struct newlink_req req;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
|
||||
@@ -160,7 +163,7 @@ static int restore_one_link(NetDeviceEntry *nde, int nlsk)
|
||||
/* FIXME -- restore mtu as well */
|
||||
|
||||
pr_info("Restoring netdev idx %d\n", nde->ifindex);
|
||||
return do_rtnl_req(nlsk, &req, sizeof(req), restore_link_cb, NULL);
|
||||
return do_rtnl_req(nlsk, &req, req.h.nlmsg_len, restore_link_cb, NULL);
|
||||
}
|
||||
|
||||
static int restore_link(NetDeviceEntry *nde, int nlsk)
|
||||
|
Reference in New Issue
Block a user