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
29cdba5a
Commit
29cdba5a
authored
Oct 18, 2017
by
Stéphane Graber
Committed by
GitHub
Oct 18, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1863 from brauner/2017-10-18/bugfixes
confile: use correct check on char array
parents
de748b7d
779b2d16
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
confile.c
src/lxc/confile.c
+3
-3
confile_utils.c
src/lxc/confile_utils.c
+3
-3
No files found.
src/lxc/confile.c
View file @
29cdba5a
...
...
@@ -3357,12 +3357,12 @@ static int get_config_network_item(const char *key, char *retv, int inlen,
if
(
!
netdev
)
return
-
1
;
if
(
strcmp
(
p1
,
"name"
)
==
0
)
{
if
(
netdev
->
name
)
if
(
netdev
->
name
[
0
]
!=
'\0'
)
strprint
(
retv
,
inlen
,
"%s"
,
netdev
->
name
);
}
else
if
(
strcmp
(
p1
,
"type"
)
==
0
)
{
strprint
(
retv
,
inlen
,
"%s"
,
lxc_net_type_to_str
(
netdev
->
type
));
}
else
if
(
strcmp
(
p1
,
"link"
)
==
0
)
{
if
(
netdev
->
link
)
if
(
netdev
->
link
[
0
]
!=
'\0'
)
strprint
(
retv
,
inlen
,
"%s"
,
netdev
->
link
);
}
else
if
(
strcmp
(
p1
,
"flags"
)
==
0
)
{
if
(
netdev
->
flags
&
IFF_UP
)
...
...
@@ -3404,7 +3404,7 @@ static int get_config_network_item(const char *key, char *retv, int inlen,
}
else
if
(
strcmp
(
p1
,
"veth.pair"
)
==
0
)
{
if
(
netdev
->
type
==
LXC_NET_VETH
)
{
strprint
(
retv
,
inlen
,
"%s"
,
netdev
->
priv
.
veth_attr
.
pair
netdev
->
priv
.
veth_attr
.
pair
[
0
]
!=
'\0'
?
netdev
->
priv
.
veth_attr
.
pair
:
netdev
->
priv
.
veth_attr
.
veth1
);
}
...
...
src/lxc/confile_utils.c
View file @
29cdba5a
...
...
@@ -256,7 +256,7 @@ void lxc_log_configured_netdevs(const struct lxc_conf *conf)
switch
(
netdev
->
type
)
{
case
LXC_NET_VETH
:
TRACE
(
"type: veth"
);
if
(
netdev
->
priv
.
veth_attr
.
pair
)
if
(
netdev
->
priv
.
veth_attr
.
pair
[
0
]
!=
'\0'
)
TRACE
(
"veth pair: %s"
,
netdev
->
priv
.
veth_attr
.
pair
);
if
(
netdev
->
priv
.
veth_attr
.
veth1
[
0
]
!=
'\0'
)
...
...
@@ -291,9 +291,9 @@ void lxc_log_configured_netdevs(const struct lxc_conf *conf)
}
TRACE
(
"flags: %s"
,
netdev
->
flags
==
IFF_UP
?
"up"
:
"none"
);
if
(
netdev
->
link
)
if
(
netdev
->
link
[
0
]
!=
'\0'
)
TRACE
(
"link: %s"
,
netdev
->
link
);
if
(
netdev
->
name
)
if
(
netdev
->
name
[
0
]
!=
'\0'
)
TRACE
(
"name: %s"
,
netdev
->
name
);
if
(
netdev
->
hwaddr
)
TRACE
(
"hwaddr: %s"
,
netdev
->
hwaddr
);
...
...
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