aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/raw.c
diff options
context:
space:
mode:
authorSoheil Hassas Yeganeh <soheil@google.com>2016-04-02 23:08:11 -0400
committerDavid S. Miller <davem@davemloft.net>2016-04-04 15:50:30 -0400
commitad1e46a837163a3e7160a1250825bcfafd2e714b (patch)
treef02d47ab7df711de7a6794fe54eae6768eb7b30f /net/ipv6/raw.c
parent24025c465f77c3585f73450bab19501b2edd6fba (diff)
ipv6: process socket-level control messages in IPv6
Process socket-level control messages by invoking __sock_cmsg_send in ip6_datagram_send_ctl for control messages on the SOL_SOCKET layer. This makes sure whenever ip6_datagram_send_ctl is called for udp and raw, we also process socket-level control messages. This is a bit uglier than IPv4, since IPv6 does not have something like ipcm_cookie. Perhaps we can later create a control message cookie for IPv6? Note that this commit interprets new control messages that were ignored before. As such, this commit does not change the behavior of IPv6 control messages. Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com> Acked-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/raw.c')
-rw-r--r--net/ipv6/raw.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index fa59dd7a427e..f175ec0a97ce 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -745,6 +745,7 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
745 struct dst_entry *dst = NULL; 745 struct dst_entry *dst = NULL;
746 struct raw6_frag_vec rfv; 746 struct raw6_frag_vec rfv;
747 struct flowi6 fl6; 747 struct flowi6 fl6;
748 struct sockcm_cookie sockc;
748 int addr_len = msg->msg_namelen; 749 int addr_len = msg->msg_namelen;
749 int hlimit = -1; 750 int hlimit = -1;
750 int tclass = -1; 751 int tclass = -1;
@@ -821,13 +822,16 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
821 if (fl6.flowi6_oif == 0) 822 if (fl6.flowi6_oif == 0)
822 fl6.flowi6_oif = sk->sk_bound_dev_if; 823 fl6.flowi6_oif = sk->sk_bound_dev_if;
823 824
825 sockc.tsflags = 0;
826
824 if (msg->msg_controllen) { 827 if (msg->msg_controllen) {
825 opt = &opt_space; 828 opt = &opt_space;
826 memset(opt, 0, sizeof(struct ipv6_txoptions)); 829 memset(opt, 0, sizeof(struct ipv6_txoptions));
827 opt->tot_len = sizeof(struct ipv6_txoptions); 830 opt->tot_len = sizeof(struct ipv6_txoptions);
828 831
829 err = ip6_datagram_send_ctl(sock_net(sk), sk, msg, &fl6, opt, 832 err = ip6_datagram_send_ctl(sock_net(sk), sk, msg, &fl6, opt,
830 &hlimit, &tclass, &dontfrag); 833 &hlimit, &tclass, &dontfrag,
834 &sockc);
831 if (err < 0) { 835 if (err < 0) {
832 fl6_sock_release(flowlabel); 836 fl6_sock_release(flowlabel);
833 return err; 837 return err;