summaryrefslogtreecommitdiffstats
path: root/test/patches/scapy-2.3.3
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2017-09-20 08:26:30 +0200
committerFlorin Coras <florin.coras@gmail.com>2018-02-01 23:41:17 +0000
commit75e7d1301475d49311d14e202936c62df0c07d10 (patch)
tree1a7e1d211cc97352f093a0207e6c94952e39e611 /test/patches/scapy-2.3.3
parent2b9453c55a7294d8eedf126d616a608c32be0e36 (diff)
IPv4/6 reassembly
Change-Id: Ic5dcadd13c88b8a5e7896dab82404509c081614a Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/patches/scapy-2.3.3')
-rw-r--r--test/patches/scapy-2.3.3/inet6.py.patch25
1 files changed, 13 insertions, 12 deletions
diff --git a/test/patches/scapy-2.3.3/inet6.py.patch b/test/patches/scapy-2.3.3/inet6.py.patch
index cf3217eb672..706e19738c4 100644
--- a/test/patches/scapy-2.3.3/inet6.py.patch
+++ b/test/patches/scapy-2.3.3/inet6.py.patch
@@ -1,7 +1,8 @@
diff --git a/scapy/layers/inet6.py b/scapy/layers/inet6.py
---- a/scapy/layers/inet6.py 2017-06-01 14:04:18.160881034 +0200
-+++ b/scapy/layers/inet6.py 2017-06-02 09:08:40.133800208 +0200
-@@ -369,6 +369,8 @@
+index 03b80ec..06ef27f 100644
+--- a/scapy/layers/inet6.py
++++ b/scapy/layers/inet6.py
+@@ -369,6 +369,8 @@ class _IPv6GuessPayload:
return Raw
elif self.nh == 135 and len(p) > 3: # Mobile IPv6
return _mip6_mhtype2cls.get(ord(p[2]), MIP6MH_Generic)
@@ -9,11 +10,11 @@ diff --git a/scapy/layers/inet6.py b/scapy/layers/inet6.py
+ return IPv6ExtHdrSegmentRouting
else:
return get_cls(ipv6nhcls.get(self.nh,"Raw"), "Raw")
-
-@@ -430,6 +432,14 @@
+
+@@ -430,6 +432,14 @@ class IPv6(_IPv6GuessPayload, Packet, IPTools):
sd = strxor(sd, a)
sd = inet_ntop(socket.AF_INET6, sd)
-
+
+ if self.nh == 43 and isinstance(self.payload, IPv6ExtHdrSegmentRouting):
+ # With segment routing header (rh == 4), the destination is
+ # the first address of the IPv6 addresses list
@@ -23,10 +24,10 @@ diff --git a/scapy/layers/inet6.py b/scapy/layers/inet6.py
+ sd = self.dst
+
if self.nh == 44 and isinstance(self.payload, IPv6ExtHdrFragment):
- nh = self.payload.nh
-
-@@ -489,6 +499,8 @@
- return self.payload.answers(other.payload.payload)
+ nh = self.payload.nh
+
+@@ -489,6 +499,8 @@ class IPv6(_IPv6GuessPayload, Packet, IPTools):
+ return self.payload.answers(other.payload.payload)
elif other.nh == 43 and isinstance(other.payload, IPv6ExtHdrRouting):
return self.payload.answers(other.payload.payload) # Buggy if self.payload is a IPv6ExtHdrRouting
+ elif other.nh == 43 and isinstance(other.payload, IPv6ExtHdrSegmentRouting):
@@ -34,10 +35,10 @@ diff --git a/scapy/layers/inet6.py b/scapy/layers/inet6.py
elif other.nh == 60 and isinstance(other.payload, IPv6ExtHdrDestOpt):
return self.payload.payload.answers(other.payload.payload)
elif self.nh == 60 and isinstance(self.payload, IPv6ExtHdrDestOpt): # BU in reply to BRR, for instance
-@@ -919,6 +931,148 @@
+@@ -919,6 +931,148 @@ class IPv6ExtHdrRouting(_IPv6ExtHdr):
pkt = pkt[:3]+struct.pack("B", len(self.addresses))+pkt[4:]
return _IPv6ExtHdr.post_build(self, pkt, pay)
-
+
+######################### Segment Routing Header ############################
+
+# This implementation is based on draft 06, available at: