diff options
Diffstat (limited to 'net/core/dev.c')
| -rw-r--r-- | net/core/dev.c | 38 | 
1 files changed, 11 insertions, 27 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index cd0981977f5c..1cb0d8a6aa6c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1136,8 +1136,8 @@ void dev_load(struct net *net, const char *name)  		no_module = request_module("netdev-%s", name);  	if (no_module && capable(CAP_SYS_MODULE)) {  		if (!request_module("%s", name)) -			pr_err("Loading kernel module for a network device with CAP_SYS_MODULE (deprecated).  Use CAP_NET_ADMIN and alias netdev-%s instead.\n", -			       name); +			pr_warn("Loading kernel module for a network device with CAP_SYS_MODULE (deprecated).  Use CAP_NET_ADMIN and alias netdev-%s instead.\n", +				name);  	}  }  EXPORT_SYMBOL(dev_load); @@ -2089,25 +2089,6 @@ static int dev_gso_segment(struct sk_buff *skb, netdev_features_t features)  	return 0;  } -/* - * Try to orphan skb early, right before transmission by the device. - * We cannot orphan skb if tx timestamp is requested or the sk-reference - * is needed on driver level for other reasons, e.g. see net/can/raw.c - */ -static inline void skb_orphan_try(struct sk_buff *skb) -{ -	struct sock *sk = skb->sk; - -	if (sk && !skb_shinfo(skb)->tx_flags) { -		/* skb_tx_hash() wont be able to get sk. -		 * We copy sk_hash into skb->rxhash -		 */ -		if (!skb->rxhash) -			skb->rxhash = sk->sk_hash; -		skb_orphan(skb); -	} -} -  static bool can_checksum_protocol(netdev_features_t features, __be16 protocol)  {  	return ((features & NETIF_F_GEN_CSUM) || @@ -2193,8 +2174,6 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,  		if (!list_empty(&ptype_all))  			dev_queue_xmit_nit(skb, dev); -		skb_orphan_try(skb); -  		features = netif_skb_features(skb);  		if (vlan_tx_tag_present(skb) && @@ -2304,7 +2283,7 @@ u16 __skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb,  	if (skb->sk && skb->sk->sk_hash)  		hash = skb->sk->sk_hash;  	else -		hash = (__force u16) skb->protocol ^ skb->rxhash; +		hash = (__force u16) skb->protocol;  	hash = jhash_1word(hash, hashrnd);  	return (u16) (((u64) hash * qcount) >> 32) + qoffset; @@ -2465,8 +2444,12 @@ static void skb_update_prio(struct sk_buff *skb)  {  	struct netprio_map *map = rcu_dereference_bh(skb->dev->priomap); -	if ((!skb->priority) && (skb->sk) && map) -		skb->priority = map->priomap[skb->sk->sk_cgrp_prioidx]; +	if (!skb->priority && skb->sk && map) { +		unsigned int prioidx = skb->sk->sk_cgrp_prioidx; + +		if (prioidx < map->priomap_len) +			skb->priority = map->priomap[prioidx]; +	}  }  #else  #define skb_update_prio(skb) @@ -6300,7 +6283,8 @@ static struct hlist_head *netdev_create_hash(void)  /* Initialize per network namespace state */  static int __net_init netdev_init(struct net *net)  { -	INIT_LIST_HEAD(&net->dev_base_head); +	if (net != &init_net) +		INIT_LIST_HEAD(&net->dev_base_head);  	net->dev_name_head = netdev_create_hash();  	if (net->dev_name_head == NULL)  | 
