From patchwork Thu Jun 30 08:06:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pravin Shelar X-Patchwork-Id: 642433 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3rgBzJ5DHmz9s9n for ; Thu, 30 Jun 2016 18:09:48 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 59A80108F2; Thu, 30 Jun 2016 01:08:11 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 9940A102B5 for ; Thu, 30 Jun 2016 01:08:09 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 283F142032D for ; Thu, 30 Jun 2016 02:08:09 -0600 (MDT) X-ASG-Debug-ID: 1467274088-09eadd4848f7d00001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar5.cudamail.com with ESMTP id 5wBwEwjLzTOGP4Bg (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 30 Jun 2016 02:08:08 -0600 (MDT) X-Barracuda-Envelope-From: pshelar@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO relay5-d.mail.gandi.net) (217.70.183.197) by mx1-pf2.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 30 Jun 2016 08:08:08 -0000 Received-SPF: pass (mx1-pf2.cudamail.com: SPF record at ovn.org designates 217.70.183.197 as permitted sender) X-Barracuda-Apparent-Source-IP: 217.70.183.197 X-Barracuda-RBL-IP: 217.70.183.197 Received: from mfilter33-d.gandi.net (mfilter33-d.gandi.net [217.70.178.164]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 2678A41C0AD; Thu, 30 Jun 2016 10:08:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter33-d.gandi.net Received: from relay5-d.mail.gandi.net ([IPv6:::ffff:217.70.183.197]) by mfilter33-d.gandi.net (mfilter33-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 0XnSJD8oPMCC; Thu, 30 Jun 2016 10:08:05 +0200 (CEST) X-Originating-IP: 24.130.10.65 Received: from localhost.localdomain.localdomain (c-24-130-10-65.hsd1.ca.comcast.net [24.130.10.65]) (Authenticated sender: pshelar@ovn.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id B539041C0D3; Thu, 30 Jun 2016 10:07:15 +0200 (CEST) X-CudaMail-Envelope-Sender: pshelar@ovn.org From: Pravin B Shelar To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E2-629002175 X-CudaMail-DTE: 063016 X-CudaMail-Originating-IP: 217.70.183.197 Date: Thu, 30 Jun 2016 01:06:27 -0700 X-ASG-Orig-Subj: [##CM-E2-629002175##][PATCH v2 10/24] datapath: compat: Update IPv6 in setup_udp_tunnel_sock() Message-Id: <1467274002-61390-10-git-send-email-pshelar@ovn.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1467274002-61390-1-git-send-email-pshelar@ovn.org> References: <1467274002-61390-1-git-send-email-pshelar@ovn.org> X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1467274088 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH v2 10/24] datapath: compat: Update IPv6 in setup_udp_tunnel_sock() X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Update setup_udp_tunnel_sock() to handle ipv6 sockets. Signed-off-by: Pravin B Shelar Acked-by: Jesse Gross --- datapath/linux/compat/include/net/udp_tunnel.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/datapath/linux/compat/include/net/udp_tunnel.h b/datapath/linux/compat/include/net/udp_tunnel.h index 0f38c26..3f02c79 100644 --- a/datapath/linux/compat/include/net/udp_tunnel.h +++ b/datapath/linux/compat/include/net/udp_tunnel.h @@ -99,7 +99,20 @@ int rpl_udp_tunnel_xmit_skb(struct rtable *rt, #define udp_tunnel_sock_release rpl_udp_tunnel_sock_release void rpl_udp_tunnel_sock_release(struct socket *sock); -#define udp_tunnel_encap_enable(sock) udp_encap_enable() +#define udp_tunnel_encap_enable rpl_udp_tunnel_encap_enable +static inline void udp_tunnel_encap_enable(struct socket *sock) +{ +#if IS_ENABLED(CONFIG_IPV6) + if (sock->sk->sk_family == PF_INET6) +#ifdef HAVE_IPV6_STUB + ipv6_stub->udpv6_encap_enable(); +#else + udpv6_encap_enable(); +#endif + else +#endif + udp_encap_enable(); +} #if IS_ENABLED(CONFIG_IPV6) #define udp_tunnel6_xmit_skb rpl_udp_tunnel6_xmit_skb