summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ping.c
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2018-07-06 10:12:54 -0400
committerDavid S. Miller <davem@davemloft.net>2018-07-07 10:58:49 +0900
commit351782067b6be81879b0af0daf7bd3acbb32d986 (patch)
tree636d78515302aeb0e8513fe7763d8e1ba0872d6c /net/ipv4/ping.c
parentab8565af68001ac5f9331daa311938ead3eb5636 (diff)
downloadlinux-351782067b6be81879b0af0daf7bd3acbb32d986.tar.bz2
ipv4: ipcm_cookie initializers
Initialize the cookie in one location to reduce code duplication and avoid bugs from inconsistent initialization, such as that fixed in commit 9887cba19978 ("ip: limit use of gso_size to udp"). Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ping.c')
-rw-r--r--net/ipv4/ping.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index b47492205507..6f17fc8ebbdb 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -739,14 +739,7 @@ static int ping_v4_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
/* no remote port */
}
- ipc.sockc.tsflags = sk->sk_tsflags;
- ipc.addr = inet->inet_saddr;
- ipc.opt = NULL;
- ipc.oif = sk->sk_bound_dev_if;
- ipc.tx_flags = 0;
- ipc.ttl = 0;
- ipc.tos = -1;
- ipc.sockc.transmit_time = 0;
+ ipcm_init_sk(&ipc, inet);
if (msg->msg_controllen) {
err = ip_cmsg_send(sk, msg, &ipc, false);