diff options
Diffstat (limited to 'net/ipv4/udp.c')
| -rw-r--r-- | net/ipv4/udp.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 2d3ded4d0786..8157b17959ee 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
| @@ -430,7 +430,7 @@ begin: | |||
| 430 | 430 | ||
| 431 | if (result) { | 431 | if (result) { |
| 432 | exact_match: | 432 | exact_match: |
| 433 | if (unlikely(!atomic_inc_not_zero(&result->sk_refcnt))) | 433 | if (unlikely(!atomic_inc_not_zero_hint(&result->sk_refcnt, 2))) |
| 434 | result = NULL; | 434 | result = NULL; |
| 435 | else if (unlikely(compute_score2(result, net, saddr, sport, | 435 | else if (unlikely(compute_score2(result, net, saddr, sport, |
| 436 | daddr, hnum, dif) < badness)) { | 436 | daddr, hnum, dif) < badness)) { |
| @@ -500,7 +500,7 @@ begin: | |||
| 500 | goto begin; | 500 | goto begin; |
| 501 | 501 | ||
| 502 | if (result) { | 502 | if (result) { |
| 503 | if (unlikely(!atomic_inc_not_zero(&result->sk_refcnt))) | 503 | if (unlikely(!atomic_inc_not_zero_hint(&result->sk_refcnt, 2))) |
| 504 | result = NULL; | 504 | result = NULL; |
| 505 | else if (unlikely(compute_score(result, net, saddr, hnum, sport, | 505 | else if (unlikely(compute_score(result, net, saddr, hnum, sport, |
| 506 | daddr, dport, dif) < badness)) { | 506 | daddr, dport, dif) < badness)) { |
| @@ -890,15 +890,13 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
| 890 | if (rt == NULL) { | 890 | if (rt == NULL) { |
| 891 | struct flowi fl = { .oif = ipc.oif, | 891 | struct flowi fl = { .oif = ipc.oif, |
| 892 | .mark = sk->sk_mark, | 892 | .mark = sk->sk_mark, |
| 893 | .nl_u = { .ip4_u = | 893 | .fl4_dst = faddr, |
| 894 | { .daddr = faddr, | 894 | .fl4_src = saddr, |
| 895 | .saddr = saddr, | 895 | .fl4_tos = tos, |
| 896 | .tos = tos } }, | ||
| 897 | .proto = sk->sk_protocol, | 896 | .proto = sk->sk_protocol, |
| 898 | .flags = inet_sk_flowi_flags(sk), | 897 | .flags = inet_sk_flowi_flags(sk), |
| 899 | .uli_u = { .ports = | 898 | .fl_ip_sport = inet->inet_sport, |
| 900 | { .sport = inet->inet_sport, | 899 | .fl_ip_dport = dport }; |
| 901 | .dport = dport } } }; | ||
| 902 | struct net *net = sock_net(sk); | 900 | struct net *net = sock_net(sk); |
| 903 | 901 | ||
| 904 | security_sk_classify_flow(sk, &fl); | 902 | security_sk_classify_flow(sk, &fl); |
| @@ -2229,7 +2227,7 @@ struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, int features) | |||
| 2229 | /* Do software UFO. Complete and fill in the UDP checksum as HW cannot | 2227 | /* Do software UFO. Complete and fill in the UDP checksum as HW cannot |
| 2230 | * do checksum of UDP packets sent as multiple IP fragments. | 2228 | * do checksum of UDP packets sent as multiple IP fragments. |
| 2231 | */ | 2229 | */ |
| 2232 | offset = skb->csum_start - skb_headroom(skb); | 2230 | offset = skb_checksum_start_offset(skb); |
| 2233 | csum = skb_checksum(skb, offset, skb->len - offset, 0); | 2231 | csum = skb_checksum(skb, offset, skb->len - offset, 0); |
| 2234 | offset += skb->csum_offset; | 2232 | offset += skb->csum_offset; |
| 2235 | *(__sum16 *)(skb->data + offset) = csum_fold(csum); | 2233 | *(__sum16 *)(skb->data + offset) = csum_fold(csum); |
