forked from mirrors/linux
		
	netdev: let netlink core handle -EMSGSIZE errors
Previous change added -EMSGSIZE handling to af_netlink, we don't have to hide these errors any longer. Theoretically the error handling changes from: if (err == -EMSGSIZE) to if (err == -EMSGSIZE && skb->len) everywhere, but in practice it doesn't matter. All messages fit into NLMSG_GOODSIZE, so overflow of an empty skb cannot happen. Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									b5a899154a
								
							
						
					
					
						commit
						0b11b1c5c3
					
				
					 2 changed files with 3 additions and 14 deletions
				
			
		|  | @ -152,10 +152,7 @@ int netdev_nl_dev_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb) | ||||||
| 	} | 	} | ||||||
| 	rtnl_unlock(); | 	rtnl_unlock(); | ||||||
| 
 | 
 | ||||||
| 	if (err != -EMSGSIZE) | 	return err; | ||||||
| 		return err; |  | ||||||
| 
 |  | ||||||
| 	return skb->len; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static int | static int | ||||||
|  | @ -287,10 +284,7 @@ int netdev_nl_napi_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb) | ||||||
| 	} | 	} | ||||||
| 	rtnl_unlock(); | 	rtnl_unlock(); | ||||||
| 
 | 
 | ||||||
| 	if (err != -EMSGSIZE) | 	return err; | ||||||
| 		return err; |  | ||||||
| 
 |  | ||||||
| 	return skb->len; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static int | static int | ||||||
|  | @ -463,10 +457,7 @@ int netdev_nl_queue_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb) | ||||||
| 	} | 	} | ||||||
| 	rtnl_unlock(); | 	rtnl_unlock(); | ||||||
| 
 | 
 | ||||||
| 	if (err != -EMSGSIZE) | 	return err; | ||||||
| 		return err; |  | ||||||
| 
 |  | ||||||
| 	return skb->len; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static int netdev_genl_netdevice_event(struct notifier_block *nb, | static int netdev_genl_netdevice_event(struct notifier_block *nb, | ||||||
|  |  | ||||||
|  | @ -102,8 +102,6 @@ netdev_nl_page_pool_get_dump(struct sk_buff *skb, struct netlink_callback *cb, | ||||||
| 	mutex_unlock(&page_pools_lock); | 	mutex_unlock(&page_pools_lock); | ||||||
| 	rtnl_unlock(); | 	rtnl_unlock(); | ||||||
| 
 | 
 | ||||||
| 	if (skb->len && err == -EMSGSIZE) |  | ||||||
| 		return skb->len; |  | ||||||
| 	return err; | 	return err; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Jakub Kicinski
						Jakub Kicinski