From 5281af1e78a377dfbd038545730c082c0a0a9b3c Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 26 Dec 2017 22:37:46 +0100 Subject: T453: QOS Match.pm shaper max-length Convert string to int before bitwise and operation Signed-off-by: Carl Byington --- lib/Vyatta/Qos/Match.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') 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 : -- cgit v1.2.3