netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Justin Iurman <justin.iurman@uliege.be>
Cc: David Ahern <dsahern@gmail.com>,
	netdev@vger.kernel.org, davem@davemloft.net,
	alex aring <alex.aring@gmail.com>
Subject: Re: [PATCH net 1/1] uapi: fix big endian definition of ipv6_rpl_sr_hdr
Date: Mon, 25 Jan 2021 13:47:25 -0800	[thread overview]
Message-ID: <20210125134725.5495f5b1@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <6FEDA1B9-14CC-4EC5-A41D-A38599C8CDBD@uliege.be>

On Mon, 25 Jan 2021 22:11:35 +0100 (CET) Justin Iurman wrote:
> >>> If you meant the old/current one, well, I don't understand why the big endian definition would look like this:
> >>> 
> >>> #elif defined(__BIG_ENDIAN_BITFIELD)
> >>>    __u32    reserved:20,
> >>>        pad:4,
> >>>        cmpri:4,
> >>>        cmpre:4;
> >>> 
> >>> When the RFC defines the header as follows:
> >>> 
> >>> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> >>> | CmprI | CmprE |  Pad  |               Reserved                |
> >>> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> >>> 
> >>> The little endian definition looks fine. But, when it comes to big endian, you define fields as you see them on the wire with the same order, right? So the current big endian definition makes no sense. It looks like it was a wrong mix with the little endian conversion.  
> > 
> > Well, you don't list the bit positions in the quote from the RFC, and
> > I'm not familiar with the IETF parlor. I'm only  
> 
> Indeed, sorry for that. Bit positions are available if you follow the link to the RFC I referenced in the patch. It is always defined as network byte order by default (=BE).
> 
> > comparing the LE
> > definition with the BE. If you claim the BE is wrong, then the LE is
> > wrong, too.  
> 
> Actually, no, it’s not. If you have a look at the header definition from the RFC, you can see that the LE is correct (valid translation from BE, the *new* BE in this patch).

Sigh, I see it now. Thanks!

  reply	other threads:[~2021-01-25 21:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21 22:00 [PATCH net 0/1] Fix big endian definition of ipv6_rpl_sr_hdr Justin Iurman
2021-01-21 22:00 ` [PATCH net 1/1] uapi: fix " Justin Iurman
2021-01-24  4:54   ` Jakub Kicinski
2021-01-24  9:57     ` Justin Iurman
2021-01-24 18:57       ` David Ahern
2021-01-25 19:32         ` Jakub Kicinski
2021-01-25 20:12           ` David Ahern
2021-01-25 20:25             ` Jakub Kicinski
2021-01-25 21:11           ` Justin Iurman
2021-01-25 21:47             ` Jakub Kicinski [this message]
2021-01-25 23:30 ` [PATCH net 0/1] Fix " patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210125134725.5495f5b1@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=alex.aring@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=justin.iurman@uliege.be \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).