From patchwork Mon Jan 28 10:48:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Parkin X-Patchwork-Id: 216161 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5A8192C008F for ; Mon, 28 Jan 2013 21:49:17 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754729Ab3A1KtO (ORCPT ); Mon, 28 Jan 2013 05:49:14 -0500 Received: from katalix.com ([82.103.140.233]:49842 "EHLO mail.katalix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754174Ab3A1KtL (ORCPT ); Mon, 28 Jan 2013 05:49:11 -0500 Received: from raven.tomandflo.local (cpc28-brad20-2-0-cust174.17-1.cable.virginmedia.com [77.97.157.175]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: tom) by mail.katalix.com (Postfix) with ESMTPSA id 0C533A620CA; Mon, 28 Jan 2013 10:49:10 +0000 (GMT) From: Tom Parkin To: netdev@vger.kernel.org Cc: jchapman@katalix.com, celston@katalix.com, Tom Parkin Subject: [PATCH 2/2] l2tp: correctly handle ancilliary data for ip6 recv Date: Mon, 28 Jan 2013 10:48:54 +0000 Message-Id: <1359370134-29875-3-git-send-email-tparkin@katalix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359370134-29875-1-git-send-email-tparkin@katalix.com> References: <1359370134-29875-1-git-send-email-tparkin@katalix.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org l2tp_ip6 was using the IPv4 recv handler function for ancilliary data. This patch changes it over to use the IPv6 handler, which allows l2tp_ip6 sockets to correctly pass ancilliary data to userspace via. recvmsg(). Ref: net/ipv6/udp.c, udpv6_recvmsg Signed-off-by: Tom Parkin Signed-off-by: Chris Elston Signed-off-by: James Chapman --- net/l2tp/l2tp_ip6.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c index 9275471..6824223 100644 --- a/net/l2tp/l2tp_ip6.c +++ b/net/l2tp/l2tp_ip6.c @@ -647,6 +647,7 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk, 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; size_t copied = 0; int err = -EOPNOTSUPP; @@ -688,8 +689,8 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk, lsa->l2tp_scope_id = IP6CB(skb)->iif; } - if (inet->cmsg_flags) - ip_cmsg_recv(msg, skb); + if (np->rxopt.all) + datagram_recv_ctl(sk, msg, skb); if (flags & MSG_TRUNC) copied = skb->len;