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: re: mpls: Add MPLS entropy label in flow_keys
Date: Wed, 10 Jun 2015 15:53:42 +0000	[thread overview]
Message-ID: <20150610155342.GM10549@mwanda> (raw)

Hello Tom Herbert,

The patch b3baa0fbd02a: "mpls: Add MPLS entropy label in flow_keys"
from Jun 4, 2015, leads to the following static checker warning:

	net/core/flow_dissector.c:303 __skb_flow_dissect()
	warn: masked condition '(() & 4294963200) = 7' is always false.

net/core/flow_dissector.c
   299                  if (!hdr)
   300                          return false;
   301  
   302                  if ((ntohl(hdr[0].entry) & MPLS_LS_LABEL_MASK) =
   303                       MPLS_LABEL_ENTROPY) {


#define MPLS_LS_LABEL_MASK      0xFFFFF000
#define MPLS_LABEL_ENTROPY              7 /* RFC6790 */

This can never be true.  Not sure what was intended.

   304                          if (skb_flow_dissector_uses_key(flow_dissector,
   305                                                          FLOW_DISSECTOR_KEY_MPLS_ENTROPY)) {
   306                                  key_keyid = skb_flow_dissector_target(flow_dissector,
   307                                                                        FLOW_DISSECTOR_KEY_MPLS_ENTROPY,
   308                                                                        target_container);
   309                                  key_keyid->keyid = hdr[1].entry &
   310                                          htonl(MPLS_LS_LABEL_MASK);
   311                          }
   312  
   313                          key_basic->n_proto = proto;
   314                          key_basic->ip_proto = ip_proto;
   315                          key_control->thoff = (u16)nhoff;
   316  
   317                          return true;
   318                  }
   319  
   320                  return true;
   321          }

regards,
dan carpenter

                 reply	other threads:[~2015-06-10 15:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20150610155342.GM10549@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