summaryrefslogtreecommitdiff
path: root/net/ipv6/ping.c
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2018-07-06 10:12:55 -0400
committerDavid S. Miller <davem@davemloft.net>2018-07-07 10:58:49 +0900
commitb515430ac9c25d5192cf498af3c6be6c4f51caad (patch)
treeb11ac766cd06f15c8eb9ae83d4cb96fecef97342 /net/ipv6/ping.c
parent351782067b6be81879b0af0daf7bd3acbb32d986 (diff)
ipv6: ipcm6_cookie initializer
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/ipv6/ping.c')
-rw-r--r--net/ipv6/ping.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c
index 96f56bf49a30..717e7c1fba29 100644
--- a/net/ipv6/ping.c
+++ b/net/ipv6/ping.c
@@ -119,7 +119,7 @@ static int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
fl6.fl6_icmp_code = user_icmph.icmp6_code;
security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
- ipc6.tclass = np->tclass;
+ ipcm6_init_sk(&ipc6, np);
fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel);
dst = ip6_sk_dst_lookup_flow(sk, &fl6, daddr, false);
@@ -142,8 +142,6 @@ static int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
pfh.family = AF_INET6;
ipc6.hlimit = ip6_sk_dst_hoplimit(np, &fl6, dst);
- ipc6.dontfrag = np->dontfrag;
- ipc6.opt = NULL;
lock_sock(sk);
err = ip6_append_data(sk, ping_getfrag, &pfh, len,