[Bug 1964] QoS/DSCP names false translated to ToS hex value
bugzilla-daemon at bugzilla.mindrot.org
bugzilla-daemon at bugzilla.mindrot.org
Fri Feb 24 15:59:03 EST 2012
https://bugzilla.mindrot.org/show_bug.cgi?id=1964
--- Comment #2 from Philip Prindeville <philipp at redfish-solutions.com> 2012-02-24 15:59:03 EST ---
(In reply to comment #1)
> Created attachment 2132 [details]
> ipqos-shift.diff
>
> shift DSCP values 2 bits right to accommodate ECN flags
The values *ARE* normalized to the TOS field being octet-aligned.
There is no shifting required.
Quoting RFC-2597:
6. Recommended Codepoints
Recommended codepoints for the four general use AF classes are given
below. These codepoints do not overlap with any other general use
PHB
groups.
The RECOMMENDED values of the AF codepoints are as follows: AF11 = '
001010', AF12 = '001100', AF13 = '001110', AF21 = '010010', AF22 = '
010100', AF23 = '010110', AF31 = '011010', AF32 = '011100', AF33 = '
011110', AF41 = '100010', AF42 = '100100', and AF43 = '100110'. The
table below summarizes the recommended AF codepoint values.
We take AF11 || 00 (i.e. shifted left 2 bits) and we get 0010100.00
which is 0x48.
Grepping through the sources, we get:
defines.h:65:# define IPTOS_DSCP_AF21 0x48
Likewise, quoting RFC-2474, Section 2:
Class Selector Codepoint: any of the eight codepoints in the range '
xxx000' (where 'x' may equal '0' or '1'). Class Selector Codepoints
are discussed in Sec. 4.2.2.
so CS1 would be 001000.00 or 0x20, indeed grepping through the source,
we get:
defines.h:78:# define IPTOS_CLASS_CS1 0x20
Again, THE VALUES DON'T REQUIRE A SHIFT.
There is no bug!
Please close this out as NOTABUG.
In the future, please check glibc's /usr/include/netinet/ip.h:
#define IPTOS_CLASS_MASK 0xe0
#define IPTOS_CLASS(class) ((class) & IPTOS_CLASS_MASK)
#define IPTOS_CLASS_CS0 0x00
#define IPTOS_CLASS_CS1 0x20
the value for the macro "class" is meant to be iph->ip_tos, which
represents all 8 bits of the TOS octet, including the ECN bits.
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
More information about the openssh-bugs
mailing list