Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nemu3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
nemu3
Commits
08ad1a96
Commit
08ad1a96
authored
Jul 20, 2010
by
Martín Ferrari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shut down interface before changing name or address
parent
28d6b27d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
src/netns/iproute.py
src/netns/iproute.py
+10
-4
No files found.
src/netns/iproute.py
View file @
08ad1a96
...
@@ -90,18 +90,24 @@ def set_if(iface, recover = True):
...
@@ -90,18 +90,24 @@ def set_if(iface, recover = True):
cmds
=
[]
cmds
=
[]
if
diff
.
name
:
if
diff
.
name
:
cmds
.
append
(
_ils
+
[
"name"
,
diff
.
name
])
cmds
.
append
(
_ils
+
[
"name"
,
diff
.
name
])
if
diff
.
mtu
:
cmds
.
append
(
_ils
+
[
"mtu"
,
str
(
diff
.
mtu
)])
if
diff
.
lladdr
:
if
diff
.
lladdr
:
cmds
.
append
(
_ils
+
[
"address"
,
diff
.
lladdr
])
cmds
.
append
(
_ils
+
[
"address"
,
diff
.
lladdr
])
if
diff
.
mtu
:
cmds
.
append
(
_ils
+
[
"mtu"
,
str
(
diff
.
mtu
)])
if
diff
.
broadcast
:
if
diff
.
broadcast
:
cmds
.
append
(
_ils
+
[
"broadcast"
,
diff
.
broadcast
])
cmds
.
append
(
_ils
+
[
"broadcast"
,
diff
.
broadcast
])
if
diff
.
up
!=
None
:
cmds
.
append
(
_ils
+
[
"up"
if
diff
.
up
else
"down"
])
if
diff
.
multicast
!=
None
:
if
diff
.
multicast
!=
None
:
cmds
.
append
(
_ils
+
[
"multicast"
,
"on"
if
diff
.
multicast
else
"off"
])
cmds
.
append
(
_ils
+
[
"multicast"
,
"on"
if
diff
.
multicast
else
"off"
])
if
diff
.
arp
!=
None
:
if
diff
.
arp
!=
None
:
cmds
.
append
(
_ils
+
[
"arp"
,
"on"
if
diff
.
arp
else
"off"
])
cmds
.
append
(
_ils
+
[
"arp"
,
"on"
if
diff
.
arp
else
"off"
])
if
diff
.
up
!=
None
:
cmds
.
append
(
_ils
+
[
"up"
if
diff
.
up
else
"down"
])
# iface needs to be down before changing name or address
if
(
diff
.
name
or
diff
.
lladdr
)
and
orig_iface
.
up
:
cmds
.
insert
(
0
,
_ils
+
[
"down"
])
if
diff
.
up
==
None
:
# if it was not set already
cmds
.
append
(
_ils
+
[
"up"
])
#print cmds
#print cmds
for
c
in
cmds
:
for
c
in
cmds
:
...
...
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