Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
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
OpenEdx
ansible
Commits
be279295
Commit
be279295
authored
Sep 27, 2013
by
Cristobal Rosa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a new check to check whether an network interface is in promiscuous mode
parent
039d4c95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
library/system/setup
+9
-0
No files found.
library/system/setup
View file @
be279295
...
...
@@ -1440,6 +1440,15 @@ class LinuxNetwork(Network):
path
=
os
.
path
.
join
(
path
,
'bonding'
,
'all_slaves_active'
)
if
os
.
path
.
exists
(
path
):
interfaces
[
device
][
'all_slaves_active'
]
=
open
(
path
)
.
read
()
==
'1'
#Check whether a interface is in promiscuous mode
if
os
.
path
.
exists
(
os
.
path
.
join
(
path
,
'flags'
)):
promisc_mode
=
False
# The second byte indicates whether the interface is in promiscuous mode.
# 1 = promisc
# 0 = no promisc
data
=
int
(
open
(
os
.
path
.
join
(
path
,
'flags'
))
.
read
()
.
strip
(),
16
)
promisc_mode
=
(
data
&
0x0100
>
0
)
interfaces
[
device
][
'promisc'
]
=
promisc_mode
ip_path
=
module
.
get_bin_path
(
"ip"
)
output
=
subprocess
.
Popen
([
ip_path
,
'addr'
,
'show'
,
device
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
.
communicate
()[
0
]
for
line
in
output
.
split
(
'
\n
'
):
...
...
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