lkml.org 
[lkml]   [2014]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH net-next v9 3/9] net: nl802154 - make add_iface take name assign type
Date
From: David Miller
> From: Tom Gundersen <teg@jklm.no>
> Date: Thu, 17 Jul 2014 10:06:04 +0200
>
> > @@ -192,8 +193,10 @@ int ieee802154_add_iface(struct sk_buff *skb, struct genl_info *info)
> > if (devname[nla_len(info->attrs[IEEE802154_ATTR_DEV_NAME]) - 1]
> > != '\0')
> > return -EINVAL; /* phy name should be null-terminated */
> > + name_assign_type = NET_NAME_USER;
> > } else {
> > devname = "wpan%d";
> > + name_assign_type = NET_NAME_ENUM;
> > }
> >
> > if (strlen(devname) >= IFNAMSIZ)
>
> Just wondering what should happen if "%d" appears in a user provided name.
>
> That would seem to be both USER and ENUM.

Is a training %d detected by special code?
Or is the string used as a printf format?
If the latter is true what happens if the user provides foo%s

David





\
 
 \ /
  Last update: 2014-07-18 11:01    [W:0.096 / U:4.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site