Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
02650b07
Commit
02650b07
authored
Sep 10, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: Sanitize dump_links() function code
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
9a6bc0fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
net.c
net.c
+4
-9
No files found.
net.c
View file @
02650b07
...
@@ -180,7 +180,7 @@ static int dump_one_link(struct nlmsghdr *hdr, void *arg)
...
@@ -180,7 +180,7 @@ static int dump_one_link(struct nlmsghdr *hdr, void *arg)
return
ret
;
return
ret
;
}
}
static
int
d
o_dump_links
(
int
(
*
cb
)(
struct
nlmsghdr
*
h
,
void
*
),
void
*
arg
)
static
int
d
ump_links
(
struct
cr_fdset
*
fds
)
{
{
int
sk
,
ret
;
int
sk
,
ret
;
struct
{
struct
{
...
@@ -188,6 +188,8 @@ static int do_dump_links(int (*cb)(struct nlmsghdr *h, void *), void *arg)
...
@@ -188,6 +188,8 @@ static int do_dump_links(int (*cb)(struct nlmsghdr *h, void *), void *arg)
struct
rtgenmsg
g
;
struct
rtgenmsg
g
;
}
req
;
}
req
;
pr_info
(
"Dumping netns links
\n
"
);
ret
=
sk
=
socket
(
PF_NETLINK
,
SOCK_RAW
,
NETLINK_ROUTE
);
ret
=
sk
=
socket
(
PF_NETLINK
,
SOCK_RAW
,
NETLINK_ROUTE
);
if
(
sk
<
0
)
{
if
(
sk
<
0
)
{
pr_perror
(
"Can't open rtnl sock for net dump"
);
pr_perror
(
"Can't open rtnl sock for net dump"
);
...
@@ -202,19 +204,12 @@ static int do_dump_links(int (*cb)(struct nlmsghdr *h, void *), void *arg)
...
@@ -202,19 +204,12 @@ static int do_dump_links(int (*cb)(struct nlmsghdr *h, void *), void *arg)
req
.
nlh
.
nlmsg_seq
=
CR_NLMSG_SEQ
;
req
.
nlh
.
nlmsg_seq
=
CR_NLMSG_SEQ
;
req
.
g
.
rtgen_family
=
AF_PACKET
;
req
.
g
.
rtgen_family
=
AF_PACKET
;
ret
=
do_rtnl_req
(
sk
,
&
req
,
sizeof
(
req
),
cb
,
arg
);
ret
=
do_rtnl_req
(
sk
,
&
req
,
sizeof
(
req
),
dump_one_link
,
fds
);
close
(
sk
);
close
(
sk
);
out:
out:
return
ret
;
return
ret
;
}
}
static
int
dump_links
(
struct
cr_fdset
*
fds
)
{
pr_info
(
"Dumping netns links
\n
"
);
return
do_dump_links
(
dump_one_link
,
fds
);
}
static
int
restore_link_cb
(
struct
nlmsghdr
*
hdr
,
void
*
arg
)
static
int
restore_link_cb
(
struct
nlmsghdr
*
hdr
,
void
*
arg
)
{
{
pr_info
(
"Got response on SETLINK =)
\n
"
);
pr_info
(
"Got response on SETLINK =)
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment