From: Xin Long <lucien.xin@gmail.com>
To: network dev <netdev@vger.kernel.org>
Cc: davem@davemloft.net, Jakub Kicinski <kuba@kernel.org>,
pabeni@redhat.com, Willem de Bruijn <willemb@google.com>,
Martin Varghese <martin.varghese@nokia.com>,
Alexander Duyck <alexander.duyck@gmail.com>,
David Howells <dhowells@redhat.com>
Subject: [PATCHv5 net-next 2/2] rxrpc: call udp_tunnel_encap_enable in rxrpc_open_socket
Date: Wed, 3 Feb 2021 16:54:23 +0800 [thread overview]
Message-ID: <2da45aee43c74c05a586a7d3c7b1f9fc48bb72f2.1612342376.git.lucien.xin@gmail.com> (raw)
In-Reply-To: <fc62f5e225f83d128ea5222cc752cb1c38c92304.1612342376.git.lucien.xin@gmail.com>
In-Reply-To: <cover.1612342376.git.lucien.xin@gmail.com>
When doing encap_enable/increasing encap_needed_key, up->encap_enabled
is not set in rxrpc_open_socket(), and it will cause encap_needed_key
not being decreased in udpv6_destroy_sock().
This patch is to improve it by just calling udp_tunnel_encap_enable()
where it increases both UDP and UDPv6 encap_needed_key and sets
up->encap_enabled.
v4->v5:
- add the missing '#include <net/udp_tunnel.h>', as David Howells
noticed.
Acked-and-tested-by: David Howells <dhowells@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
net/rxrpc/local_object.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c
index 8c28810..33b4936 100644
--- a/net/rxrpc/local_object.c
+++ b/net/rxrpc/local_object.c
@@ -16,6 +16,7 @@
#include <linux/hashtable.h>
#include <net/sock.h>
#include <net/udp.h>
+#include <net/udp_tunnel.h>
#include <net/af_rxrpc.h>
#include "ar-internal.h"
@@ -135,11 +136,7 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net)
udp_sk(usk)->gro_receive = NULL;
udp_sk(usk)->gro_complete = NULL;
- udp_encap_enable();
-#if IS_ENABLED(CONFIG_AF_RXRPC_IPV6)
- if (local->srx.transport.family == AF_INET6)
- udpv6_encap_enable();
-#endif
+ udp_tunnel_encap_enable(local->socket);
usk->sk_error_report = rxrpc_error_report;
/* if a local address was supplied then bind it */
--
2.1.0
next prev parent reply other threads:[~2021-02-03 8:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 8:54 [PATCHv5 net-next 0/2] net: enable udp v6 sockets receiving v4 packets with UDP Xin Long
2021-02-03 8:54 ` [PATCHv5 net-next 1/2] udp: call udp_encap_enable for v6 sockets when enabling encap Xin Long
2021-02-03 8:54 ` Xin Long [this message]
2021-02-03 9:50 ` [PATCHv5 net-next 2/2] rxrpc: call udp_tunnel_encap_enable in rxrpc_open_socket David Howells
2022-03-29 13:24 ` [PATCHv5 net-next 1/2] udp: call udp_encap_enable for v6 sockets when enabling encap Antonio Quartulli
2022-03-29 13:30 ` Greg Kroah-Hartman
2022-03-31 13:06 ` Antonio Quartulli
2022-04-02 11:28 ` Greg Kroah-Hartman
2021-02-05 3:00 ` [PATCHv5 net-next 0/2] net: enable udp v6 sockets receiving v4 packets with UDP patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2da45aee43c74c05a586a7d3c7b1f9fc48bb72f2.1612342376.git.lucien.xin@gmail.com \
--to=lucien.xin@gmail.com \
--cc=alexander.duyck@gmail.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=kuba@kernel.org \
--cc=martin.varghese@nokia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).