[Bug 1964] QoS/DSCP names false translated to ToS hex value

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Sat Feb 25 13:55:06 EST 2012


https://bugzilla.mindrot.org/show_bug.cgi?id=1964

--- Comment #5 from Philip Prindeville <philipp at redfish-solutions.com> 2012-02-25 13:55:06 EST ---
(In reply to comment #4)
> So it looks as if your #defines do not actually specify the hex value
> of the DSCP classes, but they define the hex value shifted left by two
> bits. For instance, cs1 is 0x08 in the RFC, but you store 0x20, which
> is <<2.

They follow the notation that's present in /usr/include/netinet/ip.h
which has been present for 20 years. It's a POSIX standard.


> This is all good and well and an implementation detail, really, but I
> think the problem is that when someone specifies IPQoS=0x08, they
> expect the same behaviour as if they specfied "cs1". However, 0x08 is
> used directly without shifting, and so OpenSSH interprets it as 0x02,
> which is undefined.

Well, hopefully that person is acquainted with the BSD Sockets source
code and it will all look very familiar to him.

> What is the reason that #defines specify shifted values instead of the
> standard values, making the shift happen explicitly later?

Precedent and compatibility with existing source.

If you look at "defines.h", it says:

#include <netinet/ip.h>
...

#ifndef IPTOS_DSCP_AF11

i.e. it can get the definition from netinet/ip.h (and it's recent
enough to contain my patches to glibc 2.12). If those definitions
aren't present, then it #define's then to duplicate names and values.

The openssh sources don't do anything that isn't exactly the same as
what's done in FreeBSD, Linux, QNX, HP-UX, Solaris, etc.

I'm really not sure what the issue is here, other than we're trying too
hard to be compatible.

-- 
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