[dts] [PATCH v1 2/3] dep nvgre: fix nvgre protocal can't analyze

Yong Liu yong.liu at intel.com
Fri Mar 11 08:43:15 CET 2016


NVGRE protocal conficted with GRE, so need to split GRE first.

Signed-off-by: Marvin Liu <yong.liu at intel.com>

diff --git a/dep/nvgre.py b/dep/nvgre.py
index d844bd1..5dd9955 100644
--- a/dep/nvgre.py
+++ b/dep/nvgre.py
@@ -9,7 +9,9 @@ NVGRE (Network Virtual GRE).
 from scapy.packet import *
 from scapy.fields import *
 from scapy.layers.inet import UDP,IP
+from scapy.layers.inet6 import IPv6
 from scapy.layers.l2 import Ether
+from scapy.layers.l2 import GRE
 
 IPPROTO_NVGRE=47
 
@@ -24,10 +26,13 @@ class NVGRE(Packet):
                    XShortField("protocoltype", 0x6558),
                    X3BytesField("TNI", 1),
                    ByteField("reserved1", 0)]
+
     def mysummary(self):          
         return self.sprintf("NVGRE (tni=%NVGRE.tni%)") 
 
 
-bind_layers(IP, NVGRE, proto=IPPROTO_NVGRE)
-bind_layers(NVGRE, Ether)
+bind_layers(NVGRE, Ether, protocoltype=0x6558)
+# fix conflict of GRE and NVGRE
+split_layers(IP, GRE, frag=0, proto=IPPROTO_NVGRE)
+bind_layers(IP, NVGRE, frag=0, proto=IPPROTO_NVGRE)
 
-- 
1.9.3



More information about the dts mailing list