X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fpatches%2Fscapy-2.3.3%2Finet6.py.patch;h=706e19738c4b24935a33375fbcb00253a17349ce;hb=6221927e9bad39c2856e844f8bc38947cb447f73;hp=f98e70915ca677409b1c35c258dd11abcd320ff0;hpb=910744394f2529ecac0fa91a16237777e023c5e6;p=vpp.git diff --git a/test/patches/scapy-2.3.3/inet6.py.patch b/test/patches/scapy-2.3.3/inet6.py.patch index f98e70915ca..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: @@ -183,3 +184,12 @@ diff --git a/scapy/layers/inet6.py b/scapy/layers/inet6.py ########################### Fragmentation Header ############################ class IPv6ExtHdrFragment(_IPv6ExtHdr): +diff --git a/scapy/layers/inet6.py b/scapy/layers/inet6.py +index 20afedf..ae3c4dd 100644 +--- a/scapy/layers/inet6.py ++++ b/scapy/layers/inet6.py +@@ -3888,3 +3888,4 @@ bind_layers(IPv6, UDP, nh = socket.IPPROTO_UDP ) + bind_layers(IP, IPv6, proto = socket.IPPROTO_IPV6 ) + bind_layers(IPv6, IPv6, nh = socket.IPPROTO_IPV6 ) + bind_layers(IPv6, IP, nh = socket.IPPROTO_IPIP ) ++bind_layers(IPv6, GRE, nh = socket.IPPROTO_GRE )