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
8843fde4
Unverified
Commit
8843fde4
authored
Sep 01, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: use correct network device name
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
b809f232
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
network.c
src/lxc/network.c
+17
-6
No files found.
src/lxc/network.c
View file @
8843fde4
...
@@ -2232,6 +2232,7 @@ static int lxc_delete_network_unpriv_exec(const char *lxcpath, char *lxcname,
...
@@ -2232,6 +2232,7 @@ static int lxc_delete_network_unpriv_exec(const char *lxcpath, char *lxcname,
}
}
if
(
child
==
0
)
{
if
(
child
==
0
)
{
char
*
hostveth
;
int
ret
;
int
ret
;
close
(
pipefd
[
0
]);
close
(
pipefd
[
0
]);
...
@@ -2245,7 +2246,11 @@ static int lxc_delete_network_unpriv_exec(const char *lxcpath, char *lxcname,
...
@@ -2245,7 +2246,11 @@ static int lxc_delete_network_unpriv_exec(const char *lxcpath, char *lxcname,
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
if
(
netdev
->
priv
.
veth_attr
.
veth1
[
0
]
==
'\0'
)
{
if
(
netdev
->
priv
.
veth_attr
.
pair
[
0
]
!=
'\0'
)
hostveth
=
netdev
->
priv
.
veth_attr
.
pair
;
else
hostveth
=
netdev
->
priv
.
veth_attr
.
veth1
;
if
(
hostveth
[
0
]
==
'\0'
)
{
SYSERROR
(
"Host side veth device name is missing"
);
SYSERROR
(
"Host side veth device name is missing"
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
...
@@ -2257,10 +2262,10 @@ static int lxc_delete_network_unpriv_exec(const char *lxcpath, char *lxcname,
...
@@ -2257,10 +2262,10 @@ static int lxc_delete_network_unpriv_exec(const char *lxcpath, char *lxcname,
}
}
INFO
(
"Execing lxc-user-nic delete %s %s %s veth %s %s"
,
lxcpath
,
INFO
(
"Execing lxc-user-nic delete %s %s %s veth %s %s"
,
lxcpath
,
lxcname
,
netns_path
,
netdev
->
link
,
netdev
->
priv
.
veth_attr
.
veth1
);
lxcname
,
netns_path
,
netdev
->
link
,
hostveth
);
execlp
(
LXC_USERNIC_PATH
,
LXC_USERNIC_PATH
,
"delete"
,
lxcpath
,
execlp
(
LXC_USERNIC_PATH
,
LXC_USERNIC_PATH
,
"delete"
,
lxcpath
,
lxcname
,
netns_path
,
"veth"
,
netdev
->
link
,
lxcname
,
netns_path
,
"veth"
,
netdev
->
link
,
hostveth
,
netdev
->
priv
.
veth_attr
.
veth1
,
(
char
*
)
NULL
);
(
char
*
)
NULL
);
SYSERROR
(
"Failed to exec lxc-user-nic."
);
SYSERROR
(
"Failed to exec lxc-user-nic."
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
...
@@ -2355,14 +2360,20 @@ bool lxc_delete_network_unpriv(struct lxc_handler *handler)
...
@@ -2355,14 +2360,20 @@ bool lxc_delete_network_unpriv(struct lxc_handler *handler)
if
(
!
is_ovs_bridge
(
netdev
->
link
))
if
(
!
is_ovs_bridge
(
netdev
->
link
))
continue
;
continue
;
if
(
netdev
->
priv
.
veth_attr
.
pair
[
0
]
!=
'\0'
)
hostveth
=
netdev
->
priv
.
veth_attr
.
pair
;
else
hostveth
=
netdev
->
priv
.
veth_attr
.
veth1
;
if
(
hostveth
[
0
]
==
'\0'
)
continue
;
ret
=
lxc_delete_network_unpriv_exec
(
handler
->
lxcpath
,
ret
=
lxc_delete_network_unpriv_exec
(
handler
->
lxcpath
,
handler
->
name
,
netdev
,
handler
->
name
,
netdev
,
netns_path
);
netns_path
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
deleted_all
=
false
;
deleted_all
=
false
;
WARN
(
"Failed to remove port
\"
%s
\"
from openvswitch "
WARN
(
"Failed to remove port
\"
%s
\"
from openvswitch "
"bridge
\"
%s
\"
"
,
"bridge
\"
%s
\"
"
,
hostveth
,
netdev
->
link
);
netdev
->
priv
.
veth_attr
.
veth1
,
netdev
->
link
);
continue
;
continue
;
}
}
INFO
(
"Removed interface
\"
%s
\"
from
\"
%s
\"
"
,
hostveth
,
INFO
(
"Removed interface
\"
%s
\"
from
\"
%s
\"
"
,
hostveth
,
...
...
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