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
779b2d16
Unverified
Commit
779b2d16
authored
Oct 18, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: use correct check on char array
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
de748b7d
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 @
779b2d16
...
@@ -3357,12 +3357,12 @@ static int get_config_network_item(const char *key, char *retv, int inlen,
...
@@ -3357,12 +3357,12 @@ static int get_config_network_item(const char *key, char *retv, int inlen,
if
(
!
netdev
)
if
(
!
netdev
)
return
-
1
;
return
-
1
;
if
(
strcmp
(
p1
,
"name"
)
==
0
)
{
if
(
strcmp
(
p1
,
"name"
)
==
0
)
{
if
(
netdev
->
name
)
if
(
netdev
->
name
[
0
]
!=
'\0'
)
strprint
(
retv
,
inlen
,
"%s"
,
netdev
->
name
);
strprint
(
retv
,
inlen
,
"%s"
,
netdev
->
name
);
}
else
if
(
strcmp
(
p1
,
"type"
)
==
0
)
{
}
else
if
(
strcmp
(
p1
,
"type"
)
==
0
)
{
strprint
(
retv
,
inlen
,
"%s"
,
lxc_net_type_to_str
(
netdev
->
type
));
strprint
(
retv
,
inlen
,
"%s"
,
lxc_net_type_to_str
(
netdev
->
type
));
}
else
if
(
strcmp
(
p1
,
"link"
)
==
0
)
{
}
else
if
(
strcmp
(
p1
,
"link"
)
==
0
)
{
if
(
netdev
->
link
)
if
(
netdev
->
link
[
0
]
!=
'\0'
)
strprint
(
retv
,
inlen
,
"%s"
,
netdev
->
link
);
strprint
(
retv
,
inlen
,
"%s"
,
netdev
->
link
);
}
else
if
(
strcmp
(
p1
,
"flags"
)
==
0
)
{
}
else
if
(
strcmp
(
p1
,
"flags"
)
==
0
)
{
if
(
netdev
->
flags
&
IFF_UP
)
if
(
netdev
->
flags
&
IFF_UP
)
...
@@ -3404,7 +3404,7 @@ static int get_config_network_item(const char *key, char *retv, int inlen,
...
@@ -3404,7 +3404,7 @@ static int get_config_network_item(const char *key, char *retv, int inlen,
}
else
if
(
strcmp
(
p1
,
"veth.pair"
)
==
0
)
{
}
else
if
(
strcmp
(
p1
,
"veth.pair"
)
==
0
)
{
if
(
netdev
->
type
==
LXC_NET_VETH
)
{
if
(
netdev
->
type
==
LXC_NET_VETH
)
{
strprint
(
retv
,
inlen
,
"%s"
,
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
.
pair
:
netdev
->
priv
.
veth_attr
.
veth1
);
:
netdev
->
priv
.
veth_attr
.
veth1
);
}
}
...
...
src/lxc/confile_utils.c
View file @
779b2d16
...
@@ -256,7 +256,7 @@ void lxc_log_configured_netdevs(const struct lxc_conf *conf)
...
@@ -256,7 +256,7 @@ void lxc_log_configured_netdevs(const struct lxc_conf *conf)
switch
(
netdev
->
type
)
{
switch
(
netdev
->
type
)
{
case
LXC_NET_VETH
:
case
LXC_NET_VETH
:
TRACE
(
"type: veth"
);
TRACE
(
"type: veth"
);
if
(
netdev
->
priv
.
veth_attr
.
pair
)
if
(
netdev
->
priv
.
veth_attr
.
pair
[
0
]
!=
'\0'
)
TRACE
(
"veth pair: %s"
,
TRACE
(
"veth pair: %s"
,
netdev
->
priv
.
veth_attr
.
pair
);
netdev
->
priv
.
veth_attr
.
pair
);
if
(
netdev
->
priv
.
veth_attr
.
veth1
[
0
]
!=
'\0'
)
if
(
netdev
->
priv
.
veth_attr
.
veth1
[
0
]
!=
'\0'
)
...
@@ -291,9 +291,9 @@ void lxc_log_configured_netdevs(const struct lxc_conf *conf)
...
@@ -291,9 +291,9 @@ void lxc_log_configured_netdevs(const struct lxc_conf *conf)
}
}
TRACE
(
"flags: %s"
,
netdev
->
flags
==
IFF_UP
?
"up"
:
"none"
);
TRACE
(
"flags: %s"
,
netdev
->
flags
==
IFF_UP
?
"up"
:
"none"
);
if
(
netdev
->
link
)
if
(
netdev
->
link
[
0
]
!=
'\0'
)
TRACE
(
"link: %s"
,
netdev
->
link
);
TRACE
(
"link: %s"
,
netdev
->
link
);
if
(
netdev
->
name
)
if
(
netdev
->
name
[
0
]
!=
'\0'
)
TRACE
(
"name: %s"
,
netdev
->
name
);
TRACE
(
"name: %s"
,
netdev
->
name
);
if
(
netdev
->
hwaddr
)
if
(
netdev
->
hwaddr
)
TRACE
(
"hwaddr: %s"
,
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