netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] bareudp: Fixed bareudp receive handling
@ 2020-03-10 17:02 Martin Varghese
  2020-03-10 17:28 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Varghese @ 2020-03-10 17:02 UTC (permalink / raw)
  To: netdev, davem, martin.varghese

From: Martin Varghese <martin.varghese@nokia.com>

Reverted commit "2baecda bareudp: remove unnecessary udp_encap_enable() in
bareudp_socket_create()"

An explicit call to udp_encap_enable is needed as the setup_udp_tunnel_sock
does not call udp_encap_enable if the if the socket is of type v6.

Bareudp device uses v6 socket to receive v4 & v6 traffic

Signed-off-by: Martin Varghese <martin.varghese@nokia.com>
Fixes: 2baecda37f4e ("bareudp: remove unnecessary udp_encap_enable() in bareudp_socket_create()")
---
 drivers/net/bareudp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c
index 71a2f48..c9d0d68 100644
--- a/drivers/net/bareudp.c
+++ b/drivers/net/bareudp.c
@@ -250,6 +250,9 @@ static int bareudp_socket_create(struct bareudp_dev *bareudp, __be16 port)
 	tunnel_cfg.encap_destroy = NULL;
 	setup_udp_tunnel_sock(bareudp->net, sock, &tunnel_cfg);
 
+	if (sock->sk->sk_family == AF_INET6)
+		udp_encap_enable();
+
 	rcu_assign_pointer(bareudp->sock, sock);
 	return 0;
 }
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-11  0:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-10 17:02 [PATCH net-next] bareudp: Fixed bareudp receive handling Martin Varghese
2020-03-10 17:28 ` Eric Dumazet
2020-03-11  0:56   ` Martin Varghese

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).