]> git.baikalelectronics.ru Git - 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)
commit6b5fc4c8f1df1fd861f4566fc1d5348616e6da46
tree6914563a59127a95e67ed7aed68b574ded74981e
parent65148ae45c94f22ed0b2945c681b7a5e7bb34f17
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