Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
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
Chen Yisong
lxc
Commits
899d65a1
Unverified
Commit
899d65a1
authored
Dec 09, 2020
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile_utils: cleanup lxc_remove_nic_by_idx()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
b0df04fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
confile_utils.c
src/lxc/confile_utils.c
+9
-11
No files found.
src/lxc/confile_utils.c
View file @
899d65a1
...
...
@@ -398,6 +398,9 @@ static void lxc_free_netdev(struct lxc_netdev *netdev)
{
struct
lxc_list
*
cur
,
*
next
;
if
(
!
netdev
)
return
;
free
(
netdev
->
upscript
);
free
(
netdev
->
downscript
);
free
(
netdev
->
hwaddr
);
...
...
@@ -434,11 +437,12 @@ static void lxc_free_netdev(struct lxc_netdev *netdev)
free
(
netdev
);
}
define_cleanup_function
(
struct
lxc_netdev
*
,
lxc_free_netdev
);
bool
lxc_remove_nic_by_idx
(
struct
lxc_conf
*
conf
,
unsigned
int
idx
)
{
call_cleaner
(
lxc_free_netdev
)
struct
lxc_netdev
*
netdev
=
NULL
;
struct
lxc_list
*
cur
,
*
next
;
struct
lxc_netdev
*
netdev
;
bool
found
=
false
;
lxc_list_for_each_safe
(
cur
,
&
conf
->
network
,
next
)
{
netdev
=
cur
->
elem
;
...
...
@@ -446,17 +450,11 @@ bool lxc_remove_nic_by_idx(struct lxc_conf *conf, unsigned int idx)
continue
;
lxc_list_del
(
cur
);
f
ound
=
true
;
break
;
f
ree
(
cur
)
;
return
true
;
}
if
(
!
found
)
return
false
;
lxc_free_netdev
(
netdev
);
free
(
cur
);
return
true
;
return
false
;
}
void
lxc_free_networks
(
struct
lxc_list
*
networks
)
...
...
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