Skip to content

Commit

Permalink
ip: stash a pointer to msghdr in struct ping_fakehdr
Browse files Browse the repository at this point in the history
... instead of storing its ->mgs_iter.iov there

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Feb 4, 2015
1 parent 2e90b1c commit cacdc7d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/net/ping.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ extern struct pingv6_ops pingv6_ops;

struct pingfakehdr {
struct icmphdr icmph;
struct iovec *iov;
struct msghdr *msg;
sa_family_t family;
__wsum wcheck;
};
Expand Down
7 changes: 3 additions & 4 deletions net/ipv4/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,14 +602,14 @@ int ping_getfrag(void *from, char *to,
if (fraglen < sizeof(struct icmphdr))
BUG();
if (csum_partial_copy_fromiovecend(to + sizeof(struct icmphdr),
pfh->iov, 0, fraglen - sizeof(struct icmphdr),
pfh->msg->msg_iter.iov, 0, fraglen - sizeof(struct icmphdr),
&pfh->wcheck))
return -EFAULT;
} else if (offset < sizeof(struct icmphdr)) {
BUG();
} else {
if (csum_partial_copy_fromiovecend
(to, pfh->iov, offset - sizeof(struct icmphdr),
(to, pfh->msg->msg_iter.iov, offset - sizeof(struct icmphdr),
fraglen, &pfh->wcheck))
return -EFAULT;
}
Expand Down Expand Up @@ -811,8 +811,7 @@ static int ping_v4_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
pfh.icmph.checksum = 0;
pfh.icmph.un.echo.id = inet->inet_sport;
pfh.icmph.un.echo.sequence = user_icmph.un.echo.sequence;
/* XXX: stripping const */
pfh.iov = (struct iovec *)msg->msg_iter.iov;
pfh.msg = msg;
pfh.wcheck = 0;
pfh.family = AF_INET;

Expand Down
3 changes: 1 addition & 2 deletions net/ipv6/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
pfh.icmph.checksum = 0;
pfh.icmph.un.echo.id = inet->inet_sport;
pfh.icmph.un.echo.sequence = user_icmph.icmp6_sequence;
/* XXX: stripping const */
pfh.iov = (struct iovec *)msg->msg_iter.iov;
pfh.msg = msg;
pfh.wcheck = 0;
pfh.family = AF_INET6;

Expand Down

0 comments on commit cacdc7d

Please sign in to comment.