Commit 7327ffe6 authored by Pavel Emelyanov's avatar Pavel Emelyanov

ns: Introduce collect_net_namespaces

And move sockets collection there.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 01f6f890
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include "syscall.h" #include "syscall.h"
#include "ptrace.h" #include "ptrace.h"
#include "util.h" #include "util.h"
#include "sockets.h"
#include "namespaces.h" #include "namespaces.h"
#include "image.h" #include "image.h"
#include "proc_parse.h" #include "proc_parse.h"
...@@ -1802,9 +1801,6 @@ int cr_dump_tasks(pid_t pid) ...@@ -1802,9 +1801,6 @@ int cr_dump_tasks(pid_t pid)
if (collect_namespaces() < 0) if (collect_namespaces() < 0)
goto err; goto err;
if (collect_sockets(pid))
goto err;
glob_imgset = cr_glob_imgset_open(O_DUMP); glob_imgset = cr_glob_imgset_open(O_DUMP);
if (!glob_imgset) if (!glob_imgset)
goto err; goto err;
......
...@@ -14,6 +14,8 @@ struct veth_pair { ...@@ -14,6 +14,8 @@ struct veth_pair {
char *outside; char *outside;
}; };
extern int collect_net_namespaces(void);
extern int network_lock(void); extern int network_lock(void);
extern void network_unlock(void); extern void network_unlock(void);
......
...@@ -536,6 +536,10 @@ int collect_namespaces(void) ...@@ -536,6 +536,10 @@ int collect_namespaces(void)
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = collect_net_namespaces();
if (ret < 0)
return ret;
return 0; return 0;
} }
......
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
#include "util-pie.h" #include "util-pie.h"
#include "plugin.h" #include "plugin.h"
#include "action-scripts.h" #include "action-scripts.h"
#include "sockets.h"
#include "pstree.h"
#include "protobuf.h" #include "protobuf.h"
#include "protobuf/netdev.pb-c.h" #include "protobuf/netdev.pb-c.h"
...@@ -625,4 +626,9 @@ int veth_pair_add(char *in, char *out) ...@@ -625,4 +626,9 @@ int veth_pair_add(char *in, char *out)
return 0; return 0;
} }
int collect_net_namespaces(void)
{
return collect_sockets(root_item->pid.real);
}
struct ns_desc net_ns_desc = NS_DESC_ENTRY(CLONE_NEWNET, "net"); struct ns_desc net_ns_desc = NS_DESC_ENTRY(CLONE_NEWNET, "net");
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