Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #67664

Bug#966459: linux: traffic class socket options (both IPv4/IPv6) inconsistent with docs/standards

From Ben Hutchings <ben@decadent.org.uk>
Newsgroups linux.debian.bugs.dist, linux.debian.kernel
Subject Bug#966459: linux: traffic class socket options (both IPv4/IPv6) inconsistent with docs/standards
Date 2020-08-02 22:40 +0200
Message-ID <AzsVY-25w-17@gated-at.bofh.it> (permalink)
References <AxCG6-6la-9@gated-at.bofh.it> <Azqr7-vc-3@gated-at.bofh.it> <Azs9z-1zu-3@gated-at.bofh.it> <AxCG6-6la-9@gated-at.bofh.it> <Azs9z-1zu-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Sun, 2020-08-02 at 19:29 +0000, Thorsten Glaser wrote:
> Ben Hutchings dixit:
> 
> >ip(7) also doesn't document IP_PKTOPIONS.
> 
> Hmm, I don’t use IP_PKTOPIONS though. I’m not exactly sure I found
> the correct place in the kernel for what I do.

The first instance of put_cmsg(...IP_TOS...) you found in
net/ipv4/ip_sockglue.c implements that socket option.

[...]
> >I see no point in changing the IPv6 behaviour: it seems to be
> >consistent with itself and with the standard
> 
> Not really: if the kernel writes an int and userspace reads
> its first byte, it only works by accident on little endian,
> but not elsewhere.

The RFC says that the IPV6_TCLASS option's value is an int, and that
"the first byte of cmsg_data[] will be the *first byte of the integer*
traffic class" (my emphasis).  We can infer from "the first byte of"
that cmsg_data[] will hold more than one byte.  And "the integer"
suggests that it's a C int, like the socket option.

> >so only risks breaking user-space that works today.
> 
> Hrm. It risks breaking userspace that reads an int. But the
> RFC clearly says it should read the first byte, not an int.
[...]

No, the wording is *not* clear.

Ben.

-- 
Ben Hutchings
It is easier to write an incorrect program
than to understand a correct one.

Back to linux.debian.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Bug#966459: linux: traffic class socket options (both IPv4/IPv6) inconsistent with docs/standards Thorsten Glaser <tg@mirbsd.de> - 2020-07-28 20:40 +0200
  Bug#966459: linux: traffic class socket options (both IPv4/IPv6) inconsistent with docs/standards Ben Hutchings <ben@decadent.org.uk> - 2020-08-02 20:00 +0200
    Bug#966459: linux: traffic class socket options (both IPv4/IPv6) inconsistent with docs/standards Thorsten Glaser <t.glaser@tarent.de> - 2020-08-02 21:50 +0200
      Bug#966459: linux: traffic class socket options (both IPv4/IPv6) inconsistent with docs/standards Ben Hutchings <ben@decadent.org.uk> - 2020-08-02 22:40 +0200
        Bug#966459: linux: traffic class socket options (both IPv4/IPv6) inconsistent with docs/standards Thorsten Glaser <t.glaser@tarent.de> - 2020-08-02 22:50 +0200
          Bug#966459: linux: traffic class socket options (both IPv4/IPv6) inconsistent with docs/standards Ben Hutchings <ben@decadent.org.uk> - 2020-08-03 05:40 +0200
            Bug#966459: linux: traffic class socket options (both IPv4/IPv6) inconsistent with docs/standards Thorsten Glaser <t.glaser@tarent.de> - 2020-08-03 19:10 +0200
              Bug#966459: linux: traffic class socket options (both IPv4/IPv6) inconsistent with docs/standards Thorsten Glaser <t.glaser@tarent.de> - 2020-08-04 21:10 +0200

csiph-web