lkml.org 
[lkml]   [2019]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net-next v5 01/22] rtnetlink: provide permanent hardware address in RTM_NEWLINK
From
From: Michal Kubecek <mkubecek@suse.cz>
Date: Mon, 25 Mar 2019 18:07:57 +0100 (CET)

> @@ -1683,6 +1684,8 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb,
> nla_put_s32(skb, IFLA_NEW_IFINDEX, new_ifindex) < 0)
> goto nla_put_failure;
>
> + if (nla_put(skb, IFLA_PERM_ADDRESS, dev->addr_len, dev->perm_addr))
> + goto nla_put_failure;
>
> rcu_read_lock();
> if (rtnl_fill_link_af(skb, dev, ext_filter_mask))

I guess, as Jiri says, we really do have to check if the driver
actually set this before pushing the attribute out to userspace.

But seriously, you chould just check for dev_addr_len zeros.

All zeros is not a valid link address on any link type.

\
 
 \ /
  Last update: 2019-03-26 20:47    [W:0.367 / U:2.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site