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
104b6a3a
Commit
104b6a3a
authored
Oct 28, 2016
by
Christian Brauner
Committed by
Stéphane Graber
Nov 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf/ile: get ip prefix via lxc_safe_uint()
Signed-off-by:
Christian Brauner
<
christian.brauner@canonical.com
>
parent
f41ee3e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
conf.h
src/lxc/conf.h
+2
-2
confile.c
src/lxc/confile.c
+8
-3
No files found.
src/lxc/conf.h
View file @
104b6a3a
...
...
@@ -62,7 +62,7 @@ enum {
struct
lxc_inetdev
{
struct
in_addr
addr
;
struct
in_addr
bcast
;
int
prefix
;
unsigned
int
prefix
;
};
struct
lxc_route
{
...
...
@@ -80,7 +80,7 @@ struct lxc_inet6dev {
struct
in6_addr
addr
;
struct
in6_addr
mcast
;
struct
in6_addr
acast
;
int
prefix
;
unsigned
int
prefix
;
};
struct
lxc_route6
{
...
...
src/lxc/confile.c
View file @
104b6a3a
...
...
@@ -848,8 +848,12 @@ static int config_network_ipv4(const char *key, const char *value,
}
/* no prefix specified, determine it from the network class */
inetdev
->
prefix
=
prefix
?
atoi
(
prefix
)
:
config_ip_prefix
(
&
inetdev
->
addr
);
if
(
prefix
)
{
if
(
lxc_safe_uint
(
prefix
,
&
inetdev
->
prefix
)
<
0
)
return
-
1
;
}
else
{
inetdev
->
prefix
=
config_ip_prefix
(
&
inetdev
->
addr
);
}
/* if no broadcast address, let compute one from the
* prefix and address
...
...
@@ -947,7 +951,8 @@ static int config_network_ipv6(const char *key, const char *value,
if
(
slash
)
{
*
slash
=
'\0'
;
netmask
=
slash
+
1
;
inet6dev
->
prefix
=
atoi
(
netmask
);
if
(
lxc_safe_uint
(
netmask
,
&
inet6dev
->
prefix
)
<
0
)
return
-
1
;
}
if
(
!
inet_pton
(
AF_INET6
,
valdup
,
&
inet6dev
->
addr
))
{
...
...
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