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:
signature.asc
Description: This is a digitally signed message part