public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [bug report] vxlan: keep flags and vni in network byte order
Date: Fri, 11 Nov 2016 12:49:41 +0000	[thread overview]
Message-ID: <20161111124941.GA3991@mwanda> (raw)

Hello Jiri Benc,

The patch 54bfd872bf16: "vxlan: keep flags and vni in network byte
order" from Feb 16, 2016, leads to the following static checker
warning:

	./include/net/vxlan.h:340 vxlan_vni()
	warn: potential shift truncation.  '0xffffff00 << 8'

include/net/vxlan.h
   335  static inline __be32 vxlan_vni(__be32 vni_field)
   336  {
   337  #if defined(__BIG_ENDIAN)
   338          return (__force __be32)((__force u32)vni_field >> 8);
   339  #else
   340          return (__force __be32)((__force u32)(vni_field & VXLAN_VNI_MASK) << 8);

Are you sure this is correct?  VXLAN_VNI_MASK already has an << 8 shift
so this feels like maybe it is a double shift.

   341  #endif
   342  }

regards,
dan carpenter

             reply	other threads:[~2016-11-11 12:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-11 12:49 Dan Carpenter [this message]
2016-11-11 13:05 ` [bug report] vxlan: keep flags and vni in network byte order Jiri Benc
2016-11-11 13:12 ` Jiri Benc
2016-11-11 13:27 ` Dan Carpenter

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=20161111124941.GA3991@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@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