In addition to #650512, there is another bug with the way ssh
sets the ToS flag on outgoing packets.
The ToS field (8 bit) is partitioned as follows:
ToS
<---------|---------|---------|---------|--------|---------|---------|--------->
<---------|---------|---------|---------|--------|---------><--------|--------->
DSCP ECN
The OpenSSH client currently translates DSCP classes directly into
their hex code and fills the entire ToS field with that. Instead, it
should bitshift the DSCP number by 2 bits to the left and OR it with
the ECN number.
E.g. class cs1 ("throughput", 0x08) becomes "000010|00". When
written directly into the ToS field, that yields a DSCP of 0x02,
which is undefined.
The 0x08 should only be written into the highest 6 bits, and the ToS
field should be 0x20 afterwards.
The same applies to class cs2 ("lowdelay", 0x10), which is written
as 00010000 (DSCP class 0x04, which is also undefined), when instead
it should be 0x40.