aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/can/raw.c3
-rw-r--r--net/core/dev.c23
-rw-r--r--net/iucv/af_iucv.c1
3 files changed, 1 insertions, 26 deletions
diff --git a/net/can/raw.c b/net/can/raw.c
index cde1b4a20f75..46cca3a91d19 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -681,9 +681,6 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock,
681 if (err < 0) 681 if (err < 0)
682 goto free_skb; 682 goto free_skb;
683 683
684 /* to be able to check the received tx sock reference in raw_rcv() */
685 skb_shinfo(skb)->tx_flags |= SKBTX_DRV_NEEDS_SK_REF;
686
687 skb->dev = dev; 684 skb->dev = dev;
688 skb->sk = sk; 685 skb->sk = sk;
689 686
diff --git a/net/core/dev.c b/net/core/dev.c
index cd0981977f5c..6df214041a5e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2089,25 +2089,6 @@ static int dev_gso_segment(struct sk_buff *skb, netdev_features_t features)
2089 return 0; 2089 return 0;
2090} 2090}
2091 2091
2092/*
2093 * Try to orphan skb early, right before transmission by the device.
2094 * We cannot orphan skb if tx timestamp is requested or the sk-reference
2095 * is needed on driver level for other reasons, e.g. see net/can/raw.c
2096 */
2097static inline void skb_orphan_try(struct sk_buff *skb)
2098{
2099 struct sock *sk = skb->sk;
2100
2101 if (sk && !skb_shinfo(skb)->tx_flags) {
2102 /* skb_tx_hash() wont be able to get sk.
2103 * We copy sk_hash into skb->rxhash
2104 */
2105 if (!skb->rxhash)
2106 skb->rxhash = sk->sk_hash;
2107 skb_orphan(skb);
2108 }
2109}
2110
2111static bool can_checksum_protocol(netdev_features_t features, __be16 protocol) 2092static bool can_checksum_protocol(netdev_features_t features, __be16 protocol)
2112{ 2093{
2113 return ((features & NETIF_F_GEN_CSUM) || 2094 return ((features & NETIF_F_GEN_CSUM) ||
@@ -2193,8 +2174,6 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
2193 if (!list_empty(&ptype_all)) 2174 if (!list_empty(&ptype_all))
2194 dev_queue_xmit_nit(skb, dev); 2175 dev_queue_xmit_nit(skb, dev);
2195 2176
2196 skb_orphan_try(skb);
2197
2198 features = netif_skb_features(skb); 2177 features = netif_skb_features(skb);
2199 2178
2200 if (vlan_tx_tag_present(skb) && 2179 if (vlan_tx_tag_present(skb) &&
@@ -2304,7 +2283,7 @@ u16 __skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb,
2304 if (skb->sk && skb->sk->sk_hash) 2283 if (skb->sk && skb->sk->sk_hash)
2305 hash = skb->sk->sk_hash; 2284 hash = skb->sk->sk_hash;
2306 else 2285 else
2307 hash = (__force u16) skb->protocol ^ skb->rxhash; 2286 hash = (__force u16) skb->protocol;
2308 hash = jhash_1word(hash, hashrnd); 2287 hash = jhash_1word(hash, hashrnd);
2309 2288
2310 return (u16) (((u64) hash * qcount) >> 32) + qoffset; 2289 return (u16) (((u64) hash * qcount) >> 32) + qoffset;
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 07d7d55a1b93..cd6f7a991d80 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -372,7 +372,6 @@ static int afiucv_hs_send(struct iucv_message *imsg, struct sock *sock,
372 skb_trim(skb, skb->dev->mtu); 372 skb_trim(skb, skb->dev->mtu);
373 } 373 }
374 skb->protocol = ETH_P_AF_IUCV; 374 skb->protocol = ETH_P_AF_IUCV;
375 skb_shinfo(skb)->tx_flags |= SKBTX_DRV_NEEDS_SK_REF;
376 nskb = skb_clone(skb, GFP_ATOMIC); 375 nskb = skb_clone(skb, GFP_ATOMIC);
377 if (!nskb) 376 if (!nskb)
378 return -ENOMEM; 377 return -ENOMEM;