[ovs-dev] [PATCH 2/2] ovs-tcpundump: allow multiple packet lengths

Aaron Conole aconole at redhat.com
Tue Oct 22 14:55:59 UTC 2019


The tcpundump tool expects all packets to be a length which aligns to
exactly a 4-nibble boundary.  This means packets like DNS requests will be
stripped before being correctly processed.  Fix this by allowing at least
two nibbles (or one byte) alignment.

Signed-off-by: Aaron Conole <aconole at redhat.com>
---
 utilities/ovs-tcpundump.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utilities/ovs-tcpundump.in b/utilities/ovs-tcpundump.in
index 1ec4f2acc..ede5448b4 100755
--- a/utilities/ovs-tcpundump.in
+++ b/utilities/ovs-tcpundump.in
@@ -57,7 +57,7 @@ if __name__ == "__main__":
         sys.exit(1)
 
     packet = ''
-    regex = re.compile(r'^\s+0x([0-9a-fA-F]+): ((?: [0-9a-fA-F]{4})+)')
+    regex = re.compile(r'^\s+0x([0-9a-fA-F]+): ((?: [0-9a-fA-F]{2,4})+)')
     while True:
         line = sys.stdin.readline()
         if line == "":
-- 
2.21.0



More information about the dev mailing list