]> git.proxmox.com Git - mirror_ovs.git/commitdiff
ovs-tcpundump: allow multiple packet lengths
authorAaron Conole <aconole@redhat.com>
Tue, 22 Oct 2019 14:55:59 +0000 (10:55 -0400)
committerBen Pfaff <blp@ovn.org>
Wed, 23 Oct 2019 17:22:11 +0000 (10:22 -0700)
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@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
utilities/ovs-tcpundump.in

index 1ec4f2acc364bc6d0200601e151de3623dff5ed0..ede5448b49643d848ab4d88929a79395e3d70a42 100755 (executable)
@@ -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 == "":