l2tp: correctly handle ancillary data in the ip6 recv path
l2tp_ip6 is incorrectly using the IPv4-specific ip_cmsg_recv to handle ancillary data. This means that socket options such as IPV6_RECVPKTINFO are not honoured in userspace. Convert l2tp_ip6 to use the IPv6-specific handler. Ref: net/ipv6/udp.c Signed-off-by: Tom Parkin <tparkin@katalix.com> Signed-off-by: James Chapman <jchapman@katalix.com> Signed-off-by: Chris Elston <celston@katalix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
8e72d37eb3
Коммит
700163db3d
|
@ -646,7 +646,7 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk,
|
||||||
struct msghdr *msg, size_t len, int noblock,
|
struct msghdr *msg, size_t len, int noblock,
|
||||||
int flags, int *addr_len)
|
int flags, int *addr_len)
|
||||||
{
|
{
|
||||||
struct inet_sock *inet = inet_sk(sk);
|
struct ipv6_pinfo *np = inet6_sk(sk);
|
||||||
struct sockaddr_l2tpip6 *lsa = (struct sockaddr_l2tpip6 *)msg->msg_name;
|
struct sockaddr_l2tpip6 *lsa = (struct sockaddr_l2tpip6 *)msg->msg_name;
|
||||||
size_t copied = 0;
|
size_t copied = 0;
|
||||||
int err = -EOPNOTSUPP;
|
int err = -EOPNOTSUPP;
|
||||||
|
@ -688,8 +688,8 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk,
|
||||||
lsa->l2tp_scope_id = IP6CB(skb)->iif;
|
lsa->l2tp_scope_id = IP6CB(skb)->iif;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inet->cmsg_flags)
|
if (np->rxopt.all)
|
||||||
ip_cmsg_recv(msg, skb);
|
ip6_datagram_recv_ctl(sk, msg, skb);
|
||||||
|
|
||||||
if (flags & MSG_TRUNC)
|
if (flags & MSG_TRUNC)
|
||||||
copied = skb->len;
|
copied = skb->len;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче