Hi all,
I found following bug in QoS NSLP version 0.5.1-dev:
The last four bytes of qspec objects , like Tmod1 and so on, is not
copied properly using following constructor, so e.g. in case of Tmod1
object the minimum_unit1 parameter has a random value.
I propose following fix:
Old code:
---------------------------------------------------------------
Tmod1::Tmod1(unsigned char *_buffer, unsigned int length) {
tail=buffer;
memcpy(buffer, _buffer, length);
tail += 20;
analyze(buffer+4, length-4);
}
-----------------------------------------------------------------
Fixed code:
-----------------------------------------------------------------
Tmod1::Tmod1(unsigned char *_buffer, unsigned int length) {
tail=buffer;
memcpy(buffer, _buffer, length+4);
tail += 20;
analyze(buffer+4, length);
}
----------------------------------------------------------------
Please note that all qspec objects should be modified in the above way.
Another option to fix the bug is to modify function:
void QspecObject::analyze(unsigned char * buffer, unsigned int length)
in the following way:
Line 184:
obj_size = paramheader.length()*4;
change to:
obj_size = (paramheader.length()+1)*4;
Best regards
Janusz