Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scapy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
scapy
Commits
6c79aef0
Commit
6c79aef0
authored
8 years ago
by
Guillaume Valadon
Committed by
Guillaume Valadon
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Pierre comments
parent
3cf623f1
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
scapy/arch/bpf/core.py
+1
-1
1 addition, 1 deletion
scapy/arch/bpf/core.py
scapy/route6.py
+1
-1
1 addition, 1 deletion
scapy/route6.py
scapy/utils6.py
+2
-4
2 additions, 4 deletions
scapy/utils6.py
with
4 additions
and
6 deletions
scapy/arch/bpf/core.py
+
1
−
1
View file @
6c79aef0
...
@@ -57,7 +57,7 @@ def get_if_raw_addr(ifname):
...
@@ -57,7 +57,7 @@ def get_if_raw_addr(ifname):
return
"
\0\0\0\0
"
return
"
\0\0\0\0
"
# Get IPv4 addresses
# Get IPv4 addresses
addresses
=
[
l
for
l
in
fd
.
readlines
()
if
l
.
find
(
"
netmask
"
)
>=
0
]
addresses
=
[
l
for
l
in
fd
if
l
.
find
(
"
netmask
"
)
>=
0
]
if
not
addresses
:
if
not
addresses
:
warning
(
"
No IPv4 address found on %s !
"
%
ifname
)
warning
(
"
No IPv4 address found on %s !
"
%
ifname
)
return
"
\0\0\0\0
"
return
"
\0\0\0\0
"
...
...
This diff is collapsed.
Click to expand it.
scapy/route6.py
+
1
−
1
View file @
6c79aef0
...
@@ -105,7 +105,7 @@ class Route6:
...
@@ -105,7 +105,7 @@ class Route6:
l
=
filter
(
lambda
x
:
in6_ptop
(
x
[
0
])
==
dst
and
x
[
1
]
==
plen
,
self
.
routes
)
l
=
filter
(
lambda
x
:
in6_ptop
(
x
[
0
])
==
dst
and
x
[
1
]
==
plen
,
self
.
routes
)
if
gw
:
if
gw
:
gw
=
in6_ptop
(
gw
)
gw
=
in6_ptop
(
gw
)
l
=
filter
(
lambda
x
:
in6_ptop
(
x
[
2
])
==
gw
,
self
.
routes
)
l
=
[
x
for
x
in
self
.
routes
if
in6_ptop
(
x
[
2
])
==
gw
]
if
len
(
l
)
==
0
:
if
len
(
l
)
==
0
:
warning
(
"
No matching route found
"
)
warning
(
"
No matching route found
"
)
elif
len
(
l
)
>
1
:
elif
len
(
l
)
>
1
:
...
...
This diff is collapsed.
Click to expand it.
scapy/utils6.py
+
2
−
4
View file @
6c79aef0
...
@@ -17,6 +17,7 @@ from scapy.config import conf
...
@@ -17,6 +17,7 @@ from scapy.config import conf
from
scapy.data
import
*
from
scapy.data
import
*
from
scapy.utils
import
*
from
scapy.utils
import
*
from
scapy.pton_ntop
import
*
from
scapy.pton_ntop
import
*
from
scapy.volatile
import
RandMAC
def
construct_source_candidate_set
(
addr
,
plen
,
laddr
,
loname
):
def
construct_source_candidate_set
(
addr
,
plen
,
laddr
,
loname
):
...
@@ -357,10 +358,7 @@ def in6_getLocalUniquePrefix():
...
@@ -357,10 +358,7 @@ def in6_getLocalUniquePrefix():
i
=
int
(
tod
)
i
=
int
(
tod
)
j
=
int
((
tod
-
i
)
*
(
2
**
32
))
j
=
int
((
tod
-
i
)
*
(
2
**
32
))
tod
=
struct
.
pack
(
"
!II
"
,
i
,
j
)
tod
=
struct
.
pack
(
"
!II
"
,
i
,
j
)
# TODO: Add some check regarding system address gathering
mac
=
RandMAC
()
from
scapy.arch
import
get_if_raw_hwaddr
rawmac
=
get_if_raw_hwaddr
(
conf
.
iface6
)[
1
]
mac
=
"
:
"
.
join
(
map
(
lambda
x
:
"
%.02x
"
%
ord
(
x
),
list
(
rawmac
)))
# construct modified EUI-64 ID
# construct modified EUI-64 ID
eui64
=
inet_pton
(
socket
.
AF_INET6
,
'
::
'
+
in6_mactoifaceid
(
mac
))[
8
:]
eui64
=
inet_pton
(
socket
.
AF_INET6
,
'
::
'
+
in6_mactoifaceid
(
mac
))[
8
:]
import
sha
import
sha
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment