diff options
author | David S. Miller <davem@davemloft.net> | 2016-04-13 22:24:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-13 22:24:52 -0400 |
commit | fbf405e80c8af9ba0a9eb6f52d3bb8cddacd6036 (patch) | |
tree | 0c1883a4c4c478746162c66befa7d5d0f8e79dc8 /net | |
parent | 99717bdfdbeaaf387ba6ecbf7eba7fbb7a47e50a (diff) | |
parent | 31c2e4926fe912f88388bcaa8450fcaa8f2ece47 (diff) | |
download | talos-obmc-linux-fbf405e80c8af9ba0a9eb6f52d3bb8cddacd6036.tar.gz talos-obmc-linux-fbf405e80c8af9ba0a9eb6f52d3bb8cddacd6036.zip |
Merge branch 'udp-hdrs-fixes'
Willem de Bruijn says:
====================
fix two more udp pull header issues
Follow up patches to the fixes to RxRPC and SunRPC. A scan of the
code showed two other interfaces that expect UDP packets to have
a udphdr when queued: read packet length with ioctl SIOCINQ and
receive payload checksum with socket option IP_CHECKSUM.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ip_sockglue.c | 3 | ||||
-rw-r--r-- | net/ipv4/udp.c | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 89b5f3bd6694..279471c4e58f 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -106,7 +106,8 @@ static void ip_cmsg_recv_checksum(struct msghdr *msg, struct sk_buff *skb, return; if (offset != 0) - csum = csum_sub(csum, csum_partial(skb->data, offset, 0)); + csum = csum_sub(csum, csum_partial(skb_transport_header(skb), + offset, 0)); put_cmsg(msg, SOL_IP, IP_CHECKSUM, sizeof(__wsum), &csum); } diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 3563788d064f..f1863136d3e4 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1282,8 +1282,6 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg) * of this packet since that is all * that will be read. */ - amount -= sizeof(struct udphdr); - return put_user(amount, (int __user *)arg); } @@ -1377,7 +1375,7 @@ try_again: *addr_len = sizeof(*sin); } if (inet->cmsg_flags) - ip_cmsg_recv_offset(msg, skb, sizeof(struct udphdr)); + ip_cmsg_recv_offset(msg, skb, sizeof(struct udphdr) + off); err = copied; if (flags & MSG_TRUNC) |