Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[sfrench/cifs-2.6.git] / net / ipv4 / udp.c
index 5ad7a26e30917fea6b356268dd9dcf38a98cdfd9..facb7e29304e7df9a7a172d2e4ad2f63acfa1074 100644 (file)
@@ -633,8 +633,11 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
                                                 .dport = dport } } };
                security_sk_classify_flow(sk, &fl);
                err = ip_route_output_flow(&rt, &fl, sk, 1);
-               if (err)
+               if (err) {
+                       if (err == -ENETUNREACH)
+                               IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
                        goto out;
+               }
 
                err = -EACCES;
                if ((rt->rt_flags & RTCF_BROADCAST) &&
@@ -848,7 +851,7 @@ try_again:
                        goto csum_copy_err;
        }
 
-       if (skb->ip_summed == CHECKSUM_UNNECESSARY)
+       if (skb_csum_unnecessary(skb))
                err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr),
                                              msg->msg_iov, copied       );
        else {
@@ -917,7 +920,7 @@ int udp_disconnect(struct sock *sk, int flags)
 }
 
 /* return:
- *     1  if the the UDP system should process it
+ *     1  if the UDP system should process it
  *     0  if we should drop this packet
  *     -1 if it should get processed by xfrm4_rcv_encap
  */
@@ -1190,7 +1193,7 @@ static inline int udp4_csum_init(struct sk_buff *skb, struct udphdr *uh,
                                      proto, skb->csum))
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
        }
-       if (skb->ip_summed != CHECKSUM_UNNECESSARY)
+       if (!skb_csum_unnecessary(skb))
                skb->csum = csum_tcpudp_nofold(iph->saddr, iph->daddr,
                                               skb->len, proto, 0);
        /* Probably, we should checksum udp header (it should be in cache