Commit 5b617ecd authored by Andrei Vagin's avatar Andrei Vagin

net: create a list of all links

We will need to enumirate links a few times
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 8cb26b02
...@@ -38,7 +38,8 @@ extern struct ns_desc net_ns_desc; ...@@ -38,7 +38,8 @@ extern struct ns_desc net_ns_desc;
#include "images/netdev.pb-c.h" #include "images/netdev.pb-c.h"
extern int write_netdev_img(NetDeviceEntry *nde, struct cr_imgset *fds, struct nlattr **info); extern int write_netdev_img(NetDeviceEntry *nde, struct cr_imgset *fds, struct nlattr **info);
extern int read_ns_sys_file(char *path, char *buf, int len); extern int read_ns_sys_file(char *path, char *buf, int len);
extern int restore_link_parms(NetDeviceEntry *nde, int nlsk); struct net_link;
extern int restore_link_parms(struct net_link *link, int nlsk);
extern int veth_pair_add(char *in, char *out); extern int veth_pair_add(char *in, char *out);
extern int macvlan_ext_add(struct external *ext); extern int macvlan_ext_add(struct external *ext);
......
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
extern const struct fdtype_ops tunfile_dump_ops; extern const struct fdtype_ops tunfile_dump_ops;
extern int dump_tun_link(NetDeviceEntry *nde, struct cr_imgset *fds, struct nlattr **info); extern int dump_tun_link(NetDeviceEntry *nde, struct cr_imgset *fds, struct nlattr **info);
extern int restore_one_tun(NetDeviceEntry *nde, int nlsk); struct net_link;
extern int restore_one_tun(struct net_link *link, int nlsk);
extern struct collect_image_info tunfile_cinfo; extern struct collect_image_info tunfile_cinfo;
extern int check_tun_cr(int no_tun_err); extern int check_tun_cr(int no_tun_err);
......
This diff is collapsed.
...@@ -439,8 +439,9 @@ int dump_tun_link(NetDeviceEntry *nde, struct cr_imgset *fds, struct nlattr **in ...@@ -439,8 +439,9 @@ int dump_tun_link(NetDeviceEntry *nde, struct cr_imgset *fds, struct nlattr **in
return write_netdev_img(nde, fds, info); return write_netdev_img(nde, fds, info);
} }
int restore_one_tun(NetDeviceEntry *nde, int nlsk) int restore_one_tun(struct net_link *link, int nlsk)
{ {
NetDeviceEntry *nde = link->nde;
int fd, ret = -1, aux; int fd, ret = -1, aux;
if (!nde->tun) { if (!nde->tun) {
...@@ -489,7 +490,7 @@ int restore_one_tun(NetDeviceEntry *nde, int nlsk) ...@@ -489,7 +490,7 @@ int restore_one_tun(NetDeviceEntry *nde, int nlsk)
goto out; goto out;
} }
if (restore_link_parms(nde, nlsk)) { if (restore_link_parms(link, nlsk)) {
pr_err("Error restoring %s link params\n", nde->name); pr_err("Error restoring %s link params\n", nde->name);
goto out; goto out;
} }
......
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