]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
rxrpc: use udp tunnel APIs instead of open code in rxrpc_open_socket
authorXin Long <lucien.xin@gmail.com>
Sun, 7 Feb 2021 08:23:14 +0000 (16:23 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Feb 2021 23:16:00 +0000 (15:16 -0800)
commit1a9b86c9fd9536b5c0dfbf7b4acbb7f61c820b74
tree6914563a59127a95e67ed7aed68b574ded74981e
parentb2f175648031b8b22927220abd3b081f1a12e628
rxrpc: use udp tunnel APIs instead of open code in rxrpc_open_socket

In rxrpc_open_socket(), now it's using sock_create_kern() and
kernel_bind() to create a udp tunnel socket, and other kernel
APIs to set up it. These code can be replaced with udp tunnel
APIs udp_sock_create() and setup_udp_tunnel_sock(), and it'll
simplify rxrpc_open_socket().

Note that with this patch, the udp tunnel socket will always
bind to a random port if transport is not provided by users,
which is suggested by David Howells, thanks!

Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Vadim Fedorenko <vfedorenko@novek.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rxrpc/local_object.c