All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Stefan Schmidt <stefan@osg.samsung.com>
Cc: linux-wpan@vger.kernel.org
Subject: Re: [PATCH wpan-tools] mac: range checking for command accepting only 0 or 1
Date: Wed, 19 Aug 2015 17:58:48 +0200	[thread overview]
Message-ID: <20150819155843.GA3759@omega> (raw)
In-Reply-To: <55D4A045.1040701@osg.samsung.com>

On Wed, Aug 19, 2015 at 05:27:01PM +0200, Stefan Schmidt wrote:
> The problem is with lbt and and autoreq_default which are boolean. We accept
> things like 400 just fine here and bring it down to 1.
> I'm going to fix this in nl802154 and leave it out of wpan-tools.
> 

We finally has the result that the userspace need to convert the value
then which is "unsigned long" and the netlink command requires "U8" or
"U16".

Then the command need check the range when it's U8:

0x00 - 0xff

and when it's U16:

0x0000 - 0xffff

The rest of ranges checks will do the kernel then. This will remove the
overflow in userspace e.g.

iwpan dev wpan0 set ackreq_default 256

will set the ackreq_default to 0. This check can't be done at
kernelspace side. The kernel need to check then if it's "0" or "1" only.

We need to introduce this behabiour for all U8 and U16 settings then.

- Alex

      reply	other threads:[~2015-08-19 15:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19 14:13 [PATCH wpan-tools] mac: range checking for command accepting only 0 or 1 Stefan Schmidt
2015-08-19 14:22 ` Alexander Aring
2015-08-19 14:28   ` Stefan Schmidt
2015-08-19 14:33     ` Alexander Aring
2015-08-19 14:38       ` Alexander Aring
2015-08-19 15:27       ` Stefan Schmidt
2015-08-19 15:58         ` Alexander Aring [this message]

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=20150819155843.GA3759@omega \
    --to=alex.aring@gmail.com \
    --cc=linux-wpan@vger.kernel.org \
    --cc=stefan@osg.samsung.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.