public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: David Laight <David.Laight@aculab.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"nikolay@nvidia.com" <nikolay@nvidia.com>,
	"roopa@nvidia.com" <roopa@nvidia.com>,
	"bernard@vivo.com" <bernard@vivo.com>,
	"mlxsw@nvidia.com" <mlxsw@nvidia.com>,
	Ido Schimmel <idosch@nvidia.com>
Subject: Re: [PATCH net-next] net: bridge: Allow base 16 inputs in sysfs
Date: Wed, 24 Nov 2021 15:16:29 +0200	[thread overview]
Message-ID: <YZ47LRq5hGw3CSCx@shredder> (raw)
In-Reply-To: <03c0d0b106954d24aba1f7417a41349f@AcuMS.aculab.com>

On Wed, Nov 24, 2021 at 12:55:33PM +0000, David Laight wrote:
> From: Ido Schimmel
> > Sent: 24 November 2021 10:11
> >
> > Cited commit converted simple_strtoul() to kstrtoul() as suggested by
> > the former's documentation. However, it also forced all the inputs to be
> > decimal resulting in user space breakage.
> > 
> > Fix by setting the base to '0' so that the base is automatically
> > detected.
> 
> Do both functions ignore leading whitespace?

With this patch (kstrtoul):

# ip link add name br0 type bridge vlan_filtering 1
# echo "    0x88a8" > /sys/class/net/br0/bridge/vlan_protocol
bash: echo: write error: Invalid argument

With simple_strtoul:

# ip link add name br0 type bridge vlan_filtering 1
# echo "    0x88a8" > /sys/class/net/br0/bridge/vlan_protocol
bash: echo: write error: Invalid argument

  reply	other threads:[~2021-11-24 13:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24 10:11 [PATCH net-next] net: bridge: Allow base 16 inputs in sysfs Ido Schimmel
2021-11-24 10:17 ` Nikolay Aleksandrov
2021-11-24 12:55 ` David Laight
2021-11-24 13:16   ` Ido Schimmel [this message]
2021-11-25  1:30 ` 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=YZ47LRq5hGw3CSCx@shredder \
    --to=idosch@idosch.org \
    --cc=David.Laight@aculab.com \
    --cc=bernard@vivo.com \
    --cc=davem@davemloft.net \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@nvidia.com \
    --cc=roopa@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox