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
05a9b967
Unverified
Commit
05a9b967
authored
Dec 08, 2020
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: cleanup get_config_net_nic()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
b67488ec
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
confile.c
src/lxc/confile.c
+7
-13
No files found.
src/lxc/confile.c
View file @
05a9b967
...
@@ -5531,31 +5531,25 @@ static int clr_config_net_veth_ipv6_route(const char *key,
...
@@ -5531,31 +5531,25 @@ static int clr_config_net_veth_ipv6_route(const char *key,
static
int
get_config_net_nic
(
const
char
*
key
,
char
*
retv
,
int
inlen
,
static
int
get_config_net_nic
(
const
char
*
key
,
char
*
retv
,
int
inlen
,
struct
lxc_conf
*
c
,
void
*
data
)
struct
lxc_conf
*
c
,
void
*
data
)
{
{
int
ret
;
__do_free
char
*
deindexed_key
=
NULL
;
ssize_t
idx
=
-
1
;
const
char
*
idxstring
;
const
char
*
idxstring
;
struct
lxc_config_t
*
config
;
struct
lxc_config_t
*
config
;
struct
lxc_netdev
*
netdev
;
struct
lxc_netdev
*
netdev
;
ssize_t
idx
=
-
1
;
char
*
deindexed_key
=
NULL
;
idxstring
=
key
+
8
;
idxstring
=
key
+
8
;
if
(
!
isdigit
(
*
idxstring
))
if
(
!
isdigit
(
*
idxstring
))
return
-
1
;
return
ret_errno
(
EINVAL
)
;
config
=
get_network_config_ops
(
key
,
c
,
&
idx
,
&
deindexed_key
);
config
=
get_network_config_ops
(
key
,
c
,
&
idx
,
&
deindexed_key
);
if
(
!
config
||
idx
<
0
)
if
(
!
config
||
idx
<
0
)
return
-
1
;
return
-
errno
;
netdev
=
lxc_get_netdev_by_idx
(
c
,
(
unsigned
int
)
idx
,
false
);
netdev
=
lxc_get_netdev_by_idx
(
c
,
(
unsigned
int
)
idx
,
false
);
if
(
!
netdev
)
{
if
(
!
netdev
)
free
(
deindexed_key
);
return
ret_errno
(
EINVAL
);
return
-
1
;
}
ret
=
config
->
get
(
deindexed_key
,
retv
,
inlen
,
c
,
netdev
);
free
(
deindexed_key
);
return
ret
;
return
config
->
get
(
deindexed_key
,
retv
,
inlen
,
c
,
netdev
)
;
}
}
static
int
get_config_net_type
(
const
char
*
key
,
char
*
retv
,
int
inlen
,
static
int
get_config_net_type
(
const
char
*
key
,
char
*
retv
,
int
inlen
,
...
...
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