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
b45e32f9
Unverified
Commit
b45e32f9
authored
Jun 16, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: remove obsolete logic
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
e5d2fd7c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
18 deletions
+7
-18
confile.c
src/lxc/confile.c
+7
-18
No files found.
src/lxc/confile.c
View file @
b45e32f9
...
@@ -943,7 +943,8 @@ static int set_network_link(const char *key, const char *value,
...
@@ -943,7 +943,8 @@ static int set_network_link(const char *key, const char *value,
return
network_ifname
(
&
netdev
->
link
,
value
);
return
network_ifname
(
&
netdev
->
link
,
value
);
}
}
static
int
create_matched_ifnames
(
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
)
static
int
create_matched_ifnames
(
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
,
struct
lxc_netdev
*
netdev
)
{
{
struct
ifaddrs
*
ifaddr
,
*
ifa
;
struct
ifaddrs
*
ifaddr
,
*
ifa
;
int
n
;
int
n
;
...
@@ -965,10 +966,10 @@ static int create_matched_ifnames(const char *value, struct lxc_conf *lxc_conf)
...
@@ -965,10 +966,10 @@ static int create_matched_ifnames(const char *value, struct lxc_conf *lxc_conf)
if
(
!
strncmp
(
value
,
ifa
->
ifa_name
,
strlen
(
value
)
-
1
))
{
if
(
!
strncmp
(
value
,
ifa
->
ifa_name
,
strlen
(
value
)
-
1
))
{
ret
=
set_config_network_type
(
type_key
,
tmpvalue
,
ret
=
set_config_network_type
(
type_key
,
tmpvalue
,
lxc_conf
,
NULL
);
lxc_conf
,
netdev
);
if
(
!
ret
)
{
if
(
!
ret
)
{
ret
=
set_network_link
(
link_key
,
ifa
->
ifa_name
,
ret
=
set_network_link
(
link_key
,
ifa
->
ifa_name
,
lxc_conf
,
NULL
);
lxc_conf
,
netdev
);
if
(
ret
)
{
if
(
ret
)
{
ERROR
(
"failed to create matched ifnames"
);
ERROR
(
"failed to create matched ifnames"
);
break
;
break
;
...
@@ -990,7 +991,6 @@ static int set_config_network_link(const char *key, const char *value,
...
@@ -990,7 +991,6 @@ static int set_config_network_link(const char *key, const char *value,
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
{
{
struct
lxc_netdev
*
netdev
;
struct
lxc_netdev
*
netdev
;
struct
lxc_list
*
it
;
int
ret
=
0
;
int
ret
=
0
;
if
(
lxc_config_value_empty
(
value
))
if
(
lxc_config_value_empty
(
value
))
...
@@ -1004,21 +1004,10 @@ static int set_config_network_link(const char *key, const char *value,
...
@@ -1004,21 +1004,10 @@ static int set_config_network_link(const char *key, const char *value,
if
(
!
netdev
)
if
(
!
netdev
)
return
-
1
;
return
-
1
;
if
(
value
[
strlen
(
value
)
-
1
]
==
'+'
&&
netdev
->
type
==
LXC_NET_PHYS
)
{
if
(
value
[
strlen
(
value
)
-
1
]
==
'+'
&&
netdev
->
type
==
LXC_NET_PHYS
)
/* Get the last network list and remove it. */
ret
=
create_matched_ifnames
(
value
,
lxc_conf
,
netdev
);
it
=
lxc_conf
->
network
.
prev
;
else
if
(((
struct
lxc_netdev
*
)(
it
->
elem
))
->
type
!=
LXC_NET_PHYS
)
{
ERROR
(
"lxc config cannot support string pattern "
"matching for this link type"
);
return
-
1
;
}
lxc_list_del
(
it
);
free
(
it
);
ret
=
create_matched_ifnames
(
value
,
lxc_conf
);
}
else
{
ret
=
network_ifname
(
&
netdev
->
link
,
value
);
ret
=
network_ifname
(
&
netdev
->
link
,
value
);
}
return
ret
;
return
ret
;
}
}
...
...
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