net: ping6: support setting basic SOL_IPV6 options via cmsg
authorJakub Kicinski <kuba@kernel.org>
Thu, 17 Feb 2022 01:21:16 +0000 (17:21 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Feb 2022 14:22:09 +0000 (14:22 +0000)
commit13651224c00b74a02c731b7840577f14e0311c83
treed10073f30bfd0653e95f65b872bfe878ecfd4aa7
parentd54f16c7fa3bc350b07049e0c0046c59bcbe7c3e
net: ping6: support setting basic SOL_IPV6 options via cmsg

Support setting IPV6_HOPLIMIT, IPV6_TCLASS, IPV6_DONTFRAG
during sendmsg via SOL_IPV6 cmsgs.

tclass and dontfrag are init'ed from struct ipv6_pinfo in
ipcm6_init_sk(), while hlimit is inited to -1, so we need
to handle it being populated via cmsg explicitly.

Leave extension headers and flowlabel unimplemented.
Those are slightly more laborious to test and users
seem to primarily care about IPV6_TCLASS.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_output.c
net/ipv6/ping.c