new helper: skb_copy_and_csum_datagram_msg()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 6 Apr 2014 22:47:38 +0000 (18:47 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 24 Nov 2014 09:28:44 +0000 (04:28 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
include/linux/skbuff.h
net/ipv4/udp.c
net/ipv6/raw.c
net/ipv6/udp.c

index 78c299f40baccc13f2f099e188ffb3a5dcdc0c26..cbe4b2078b30dc4d3fc66b462aa957fabbe5836c 100644 (file)
@@ -2651,6 +2651,11 @@ static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset,
 }
 int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, int hlen,
                                     struct iovec *iov);
+static inline int skb_copy_and_csum_datagram_msg(struct sk_buff *skb, int hlen,
+                           struct msghdr *msg)
+{
+       return skb_copy_and_csum_datagram_iovec(skb, hlen, msg->msg_iov);
+}
 int skb_copy_datagram_from_iovec(struct sk_buff *skb, int offset,
                                 const struct iovec *from, int from_offset,
                                 int len);
index 4a16b9129079791e160634f4dfdcd0302beab568..b2d606833ce4bd725b3b1929d481d4c49d5ebcd2 100644 (file)
@@ -1284,9 +1284,8 @@ try_again:
                err = skb_copy_datagram_msg(skb, sizeof(struct udphdr),
                                            msg, copied);
        else {
-               err = skb_copy_and_csum_datagram_iovec(skb,
-                                                      sizeof(struct udphdr),
-                                                      msg->msg_iov);
+               err = skb_copy_and_csum_datagram_msg(skb, sizeof(struct udphdr),
+                                                    msg);
 
                if (err == -EINVAL)
                        goto csum_copy_err;
index 0cbcf98f2cabe2adfacb1f07372524099e56391b..8baa53e17a3044031417976feca82a183eb9cdb7 100644 (file)
@@ -492,7 +492,7 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk,
                        goto csum_copy_err;
                err = skb_copy_datagram_msg(skb, 0, msg, copied);
        } else {
-               err = skb_copy_and_csum_datagram_iovec(skb, 0, msg->msg_iov);
+               err = skb_copy_and_csum_datagram_msg(skb, 0, msg);
                if (err == -EINVAL)
                        goto csum_copy_err;
        }
index dbc0b042bdd6b09eeb3adf5fd81b8bb8bf727515..7cfb5d745a2d4c6b3b3b524f947f69a2a692209c 100644 (file)
@@ -428,7 +428,7 @@ try_again:
                err = skb_copy_datagram_msg(skb, sizeof(struct udphdr),
                                            msg, copied);
        else {
-               err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr), msg->msg_iov);
+               err = skb_copy_and_csum_datagram_msg(skb, sizeof(struct udphdr), msg);
                if (err == -EINVAL)
                        goto csum_copy_err;
        }