[Ecn-sane] Fwd: [PATCH net] ipv4: Ignore ECN bits for fib lookups in fib_compute_spec_dst()

Jonathan Morton chromatix99 at gmail.com
Tue Dec 29 15:59:23 EST 2020


> On 29 Dec, 2020, at 10:13 pm, Rodney W. Grimes <4bone at gndrsh.dnsmgr.net> wrote:
> 
> If these are purely kernel macros that scope of work is well contained.  Are these macro's exported from a header to userland visible code?

It appears RT_TOS is defined in a "uapi" header, that is, Userspace API.  So yes, and this also means any bugs in it have propagated into userspace code built against it.

Actually, it looks like it is not a bug in the macro itself, but in its intended application, referring to an obsolete and very short-lived specification.  It's extracting *specifically* the widened Type of Service bitfield, containing the non-orthogonal "flags" indicating Max Throughput, Min Latency, Max Reliability, and Min Cost (this last being the short-lived part of the spec, as Diffserv and ECN replaced it very quickly).  The mask specifically excludes the Precedence field and thus the most-significant half of the Diffserv field.

 - Jonathan Morton


More information about the Ecn-sane mailing list