DSCP value should be a 6 bit field
TOS was 8bits, but only the upper 6 bits became DSCP. The VTY command for DSCP in OsmoMGW accepts an 8 bit value. We are setting the setsockopt for TOS with that value without bit-shifting.
This came up while writing a similar patch for setting DSCP for OsmoBTS.
a) shift it two bits up and adjust the command syntax (and config template) to restrict to 0..63 (backwards incompatible)
b) change the description of the VTY command, so it is obvious that we are actually setting the TOS? (probably confusing)
Updated by laforge over 3 years ago
I think this cannot really be changed/fixed in a backwards-compatible way.
Please note that the kernel will likely mask the lower two bits, and any intermediate
router can modify them on congestion (that's what ECN is for, after all).
So I guess the best we can do is to document that we expect the 6-bit DCSP value shifted
left two bits, and that the lower two bits should be zero.