mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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 <[email protected]> Acked-by: Willem de Bruijn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
24025c465f
commit
ad1e46a837
7 changed files with 28 additions and 9 deletions
|
|
@ -492,6 +492,7 @@ static int l2tp_ip6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
|
|||
struct ip6_flowlabel *flowlabel = NULL;
|
||||
struct dst_entry *dst = NULL;
|
||||
struct flowi6 fl6;
|
||||
struct sockcm_cookie sockc_unused = {0};
|
||||
int addr_len = msg->msg_namelen;
|
||||
int hlimit = -1;
|
||||
int tclass = -1;
|
||||
|
|
@ -562,9 +563,10 @@ static int l2tp_ip6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
|
|||
memset(opt, 0, sizeof(struct ipv6_txoptions));
|
||||
opt->tot_len = sizeof(struct ipv6_txoptions);
|
||||
|
||||
err = ip6_datagram_send_ctl(sock_net(sk), sk, msg, &fl6, opt,
|
||||
&hlimit, &tclass, &dontfrag);
|
||||
if (err < 0) {
|
||||
err = ip6_datagram_send_ctl(sock_net(sk), sk, msg, &fl6, opt,
|
||||
&hlimit, &tclass, &dontfrag,
|
||||
&sockc_unused);
|
||||
if (err < 0) {
|
||||
fl6_sock_release(flowlabel);
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue