Browse Source

new helper: skb_copy_and_csum_datagram_msg()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
imx_4.1.15_1.0.0_ga
Al Viro 7 years ago
parent
commit
227158db16
4 changed files with 9 additions and 5 deletions
  1. +5
    -0
      include/linux/skbuff.h
  2. +2
    -3
      net/ipv4/udp.c
  3. +1
    -1
      net/ipv6/raw.c
  4. +1
    -1
      net/ipv6/udp.c

+ 5
- 0
include/linux/skbuff.h View 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);


+ 2
- 3
net/ipv4/udp.c View 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;


+ 1
- 1
net/ipv6/raw.c View 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;
}


+ 1
- 1
net/ipv6/udp.c View 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;
}


Loading…
Cancel
Save