forked from mirrors/linux
		
	rtnetlink: Allocate linkinfo[] as struct rtnl_newlink_tbs.
We will move linkinfo to rtnl_newlink() and pass it down to other functions. Let's pack it into rtnl_newlink_tbs. Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
		
							parent
							
								
									6f07cd8301
								
							
						
					
					
						commit
						fa8ef258da
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -3622,6 +3622,7 @@ static int rtnl_newlink_create(struct sk_buff *skb, struct ifinfomsg *ifm,
 | 
			
		|||
 | 
			
		||||
struct rtnl_newlink_tbs {
 | 
			
		||||
	struct nlattr *tb[IFLA_MAX + 1];
 | 
			
		||||
	struct nlattr *linkinfo[IFLA_INFO_MAX + 1];
 | 
			
		||||
	struct nlattr *attr[RTNL_MAX_TYPE + 1];
 | 
			
		||||
	struct nlattr *slave_attr[RTNL_SLAVE_MAX_TYPE + 1];
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			@ -3630,7 +3631,7 @@ static int __rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
 | 
			
		|||
			  struct rtnl_newlink_tbs *tbs,
 | 
			
		||||
			  struct netlink_ext_ack *extack)
 | 
			
		||||
{
 | 
			
		||||
	struct nlattr *linkinfo[IFLA_INFO_MAX + 1];
 | 
			
		||||
	struct nlattr ** const linkinfo = tbs->linkinfo;
 | 
			
		||||
	struct nlattr ** const tb = tbs->tb;
 | 
			
		||||
	const struct rtnl_link_ops *m_ops;
 | 
			
		||||
	struct net_device *master_dev;
 | 
			
		||||
| 
						 | 
				
			
			@ -3685,8 +3686,9 @@ static int __rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
 | 
			
		|||
						  ifla_info_policy, NULL);
 | 
			
		||||
		if (err < 0)
 | 
			
		||||
			return err;
 | 
			
		||||
	} else
 | 
			
		||||
		memset(linkinfo, 0, sizeof(linkinfo));
 | 
			
		||||
	} else {
 | 
			
		||||
		memset(linkinfo, 0, sizeof(tbs->linkinfo));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (linkinfo[IFLA_INFO_KIND]) {
 | 
			
		||||
		nla_strscpy(kind, linkinfo[IFLA_INFO_KIND], sizeof(kind));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue