commit 3d6ff01715671c645c6d9ffa372aa9d521c71e72 Author: Carl Byington Date: Tue Nov 21 15:52:09 2017 -0800 convert string to int before bitwise and operation diff --git a/lib/Vyatta/Qos/Match.pm b/lib/Vyatta/Qos/Match.pm index c8078b6..f08c317 100644 --- a/lib/Vyatta/Qos/Match.pm +++ b/lib/Vyatta/Qos/Match.pm @@ -184,9 +184,9 @@ sub filter { # IPv6 : match u16 0x0000 ~MAXLEN at 4 if ($$p{maxlen}) { if ( $proto eq 'ip' ) { - printf " match u16 0x0000 %#.4x at 2", (hex('0xFFFF') & ~($$p{maxlen})); + printf " match u16 0x0000 %#.4x at 2", 0xffff & ~int($$p{maxlen}); } elsif ( $proto eq 'ipv6' ) { - printf " match u16 0x0000 %#.4x at 4", (hex('0xFFFF') & ~($$p{maxlen})); + printf " match u16 0x0000 %#.4x at 4", 0xffff & ~int($$p{maxlen}); } } # TCP Flags :