Page Menu
Home
VyOS Platform
Search
Configure Global Search
Log In
Files
F27881
string.to.int.patch
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
carl.byington
Nov 21 2017, 11:56 PM
2017-11-21 23:56:49 (UTC+0)
Size
973 B
Referenced Files
None
Subscribers
None
string.to.int.patch
View Options
commit 3d6ff01715671c645c6d9ffa372aa9d521c71e72
Author: Carl Byington <carl@five-ten-sg.com>
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 :
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/nt/dt/aiuray5ehhyhakia
Default Alt Text
string.to.int.patch (973 B)
Attached To
Mode
T453: Qos/Match.pm shaper max-length
Attached
Detach File
Event Timeline
Log In to Comment