On 5/29/2015 10:41 AM, Flavio Leitner wrote:
On Fri, May 29, 2015 at 10:18:56AM -0700, Sridhar Samudrala wrote:
> @@ -458,6 +458,9 @@ static int do_create(struct team_handle *th, const char
*team_name, bool recreat
> return -ENOMEM;
>
> if (team_name) {
> + if (strlen(team_name) >= IFNAMSIZ)
> + return -ENAMETOOLONG;
> +
> rtnl_link_set_name(link, team_name);
>
> if (recreate && team_ifname2ifindex(th, team_name)) {
It looks odd to me that the libnl exposes an API such that it receives
its opaque object and a string and Team is responsible for checking if
the string fits into libnl purposes.
I see some discussion to add this check to
rtnl_link_set_name(), but it
looks like that
patch didn't make it to libnl.
http://lists.infradead.org/pipermail/libnl/2014-January/001223.html
http://lists.infradead.org/pipermail/libnl/2014-January/001224.html
I'd assume that Team passes any string as interface name and libnl
would either do some checking or try and then report errors back to
the caller.
fbl