Page MenuHomeVyOS Platform

Qos/Match.pm shaper max-length
Closed, ResolvedPublicBUG

Description

p{maxlen} is a string, needs to be converted to int before bitwise and.

Code near line 187 should be:

if ($$p{maxlen}) {
    if ( $proto eq 'ip' ) {
        printf " match u16 0x0000 %#.4x at 2", 0xffff & ~int($$p{maxlen});
    } elsif ( $proto eq 'ipv6' ) {
        printf " match u16 0x0000 %#.4x at 4", 0xffff & ~int($$p{maxlen});
    }
}

Details

Difficulty level
Easy (less than an hour)
Version
999.201711072137
Why the issue appeared?
Will be filled on close