[ovs-dev] ovs-tcpundump: fix a conversion issue
diff mbox series

Message ID 20180112204021.12078-1-aconole@redhat.com
State Accepted
Headers show
Series
  • [ovs-dev] ovs-tcpundump: fix a conversion issue
Related show

Commit Message

Aaron Conole Jan. 12, 2018, 8:40 p.m. UTC
When I tried using ovs-tcpundump, I got the following error message:
Traceback (most recent call last):
  File ./ovs-tcpundump, line 64, in <module>
    if m is None or int(m.group(1)) == 0:
ValueError: invalid literal for int() with base 10: '00a0'

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

Comments

Ben Pfaff Jan. 12, 2018, 9:09 p.m. UTC | #1
On Fri, Jan 12, 2018 at 03:40:21PM -0500, Aaron Conole wrote:
> When I tried using ovs-tcpundump, I got the following error message:
> Traceback (most recent call last):
>   File ./ovs-tcpundump, line 64, in <module>
>     if m is None or int(m.group(1)) == 0:
> ValueError: invalid literal for int() with base 10: '00a0'
> 
> Signed-off-by: Aaron Conole <aconole@redhat.com>

Thanks for the fix.  I applied this to master and backported as far as
2.0.

Patch
diff mbox series

diff --git a/utilities/ovs-tcpundump.in b/utilities/ovs-tcpundump.in
index 57300cdc1..c99015b5b 100755
--- a/utilities/ovs-tcpundump.in
+++ b/utilities/ovs-tcpundump.in
@@ -61,7 +61,7 @@  if __name__ == "__main__":
             break
 
         m = regex.match(line)
-        if m is None or int(m.group(1)) == 0:
+        if m is None or int(m.group(1), 16) == 0:
             if packet != '':
                 print packet
             packet = ''