Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless <linux-wireless@vger.kernel.org>
Cc: "John W. Linville" <linville@tuxdriver.com>, Greg KH <greg@kroah.com>
Subject: Re: [PATCH] allow wiphy renaming
Date: Thu, 01 Mar 2007 12:29:52 +0100	[thread overview]
Message-ID: <1172748592.11911.32.camel@johannes.berg> (raw)
In-Reply-To: <1172672119.5015.11.camel@johannes.berg>

[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]

On Wed, 2007-02-28 at 15:15 +0100, Johannes Berg wrote:
> This patch enables userspace to rename 802.11 PHYs via nl80211. It adds
> the first multicast group and notifies it of these renames as well.

> Tested and works :)

Well, I forgot to test the corner cases. The patch is somewhat broken.

> +	/* prohibit calling the thing phy%d when %d is not its number */
> +	sscanf(newname, PHY_NAME "%n", &idx, &taken);
> +	if (taken == strlen(newname) && idx != rdev->idx)
> +		return -EINVAL;

sscanf has a bug that makes this use case not work. If it worked
correctly, this would also disallow things like 'phy007' when the index
is not 7.

The whole point in disallowing something other than the own number was
to simplify code in other places so I don't have to check for used
numbers when assigning new ones. Any comments on the whole thing? I
kinda fear that if I go through with this someone will show up who
really desperately needs to call something phy7 when it has index 22 and
I will be held responsible ;)

OTOH, this may be an incentive to not use phy* for stable names to begin
with, avoiding the problem we see with netdevs and people continually
complaining about unstable names...

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

  reply	other threads:[~2007-03-01 11:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-28 14:15 [PATCH] allow wiphy renaming Johannes Berg
2007-03-01 11:29 ` Johannes Berg [this message]
2007-03-26 10:47   ` Johannes Berg
2007-03-26 11:23     ` Johannes Berg

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=1172748592.11911.32.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=greg@kroah.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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