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
40790553
Commit
40790553
authored
Feb 17, 2014
by
Serge Hallyn
Committed by
Stéphane Graber
Feb 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't skip setting network properties in unpriv case
Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
Acked-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
parent
f338fa89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
conf.c
src/lxc/conf.c
+12
-7
No files found.
src/lxc/conf.c
View file @
40790553
...
@@ -2374,16 +2374,19 @@ static int setup_netdev(struct lxc_netdev *netdev)
...
@@ -2374,16 +2374,19 @@ static int setup_netdev(struct lxc_netdev *netdev)
return
-
1
;
return
-
1
;
}
}
}
}
return
0
;
if
(
netdev
->
type
!=
LXC_NET_VETH
)
return
0
;
netdev
->
ifindex
=
if_nametoindex
(
netdev
->
name
);
}
}
/* get the new ifindex in case of physical netdev */
/* get the new ifindex in case of physical netdev */
if
(
netdev
->
type
==
LXC_NET_PHYS
)
if
(
netdev
->
type
==
LXC_NET_PHYS
)
{
if
(
!
(
netdev
->
ifindex
=
if_nametoindex
(
netdev
->
link
)))
{
if
(
!
(
netdev
->
ifindex
=
if_nametoindex
(
netdev
->
link
)))
{
ERROR
(
"failed to get ifindex for %s"
,
ERROR
(
"failed to get ifindex for %s"
,
netdev
->
link
);
netdev
->
link
);
return
-
1
;
return
-
1
;
}
}
}
/* retrieve the name of the interface */
/* retrieve the name of the interface */
if
(
!
if_indextoname
(
netdev
->
ifindex
,
current_ifname
))
{
if
(
!
if_indextoname
(
netdev
->
ifindex
,
current_ifname
))
{
...
@@ -2398,11 +2401,13 @@ static int setup_netdev(struct lxc_netdev *netdev)
...
@@ -2398,11 +2401,13 @@ static int setup_netdev(struct lxc_netdev *netdev)
netdev
->
link
:
"eth%d"
;
netdev
->
link
:
"eth%d"
;
/* rename the interface name */
/* rename the interface name */
err
=
lxc_netdev_rename_by_name
(
ifname
,
netdev
->
name
);
if
(
strcmp
(
ifname
,
netdev
->
name
)
!=
0
)
{
if
(
err
)
{
err
=
lxc_netdev_rename_by_name
(
ifname
,
netdev
->
name
);
ERROR
(
"failed to rename %s->%s : %s"
,
ifname
,
netdev
->
name
,
if
(
err
)
{
strerror
(
-
err
));
ERROR
(
"failed to rename %s->%s : %s"
,
ifname
,
netdev
->
name
,
return
-
1
;
strerror
(
-
err
));
return
-
1
;
}
}
}
/* Re-read the name of the interface because its name has changed
/* Re-read the name of the interface because its name has changed
...
...
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