aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc/local_object.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/rxrpc/local_object.c')
-rw-r--r--net/rxrpc/local_object.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c
index 94d234e9c685..cad0691c2bb4 100644
--- a/net/rxrpc/local_object.c
+++ b/net/rxrpc/local_object.c
@@ -19,6 +19,7 @@
19#include <linux/ip.h> 19#include <linux/ip.h>
20#include <linux/hashtable.h> 20#include <linux/hashtable.h>
21#include <net/sock.h> 21#include <net/sock.h>
22#include <net/udp.h>
22#include <net/af_rxrpc.h> 23#include <net/af_rxrpc.h>
23#include "ar-internal.h" 24#include "ar-internal.h"
24 25
@@ -108,7 +109,7 @@ static struct rxrpc_local *rxrpc_alloc_local(struct rxrpc_net *rxnet,
108 */ 109 */
109static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net) 110static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net)
110{ 111{
111 struct sock *sock; 112 struct sock *usk;
112 int ret, opt; 113 int ret, opt;
113 114
114 _enter("%p{%d,%d}", 115 _enter("%p{%d,%d}",
@@ -122,6 +123,28 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net)
122 return ret; 123 return ret;
123 } 124 }
124 125
126 /* set the socket up */
127 usk = local->socket->sk;
128 inet_sk(usk)->mc_loop = 0;
129
130 /* Enable CHECKSUM_UNNECESSARY to CHECKSUM_COMPLETE conversion */
131 inet_inc_convert_csum(usk);
132
133 rcu_assign_sk_user_data(usk, local);
134
135 udp_sk(usk)->encap_type = UDP_ENCAP_RXRPC;
136 udp_sk(usk)->encap_rcv = rxrpc_input_packet;
137 udp_sk(usk)->encap_destroy = NULL;
138 udp_sk(usk)->gro_receive = NULL;
139 udp_sk(usk)->gro_complete = NULL;
140
141 udp_encap_enable();
142#if IS_ENABLED(CONFIG_IPV6)
143 if (local->srx.transport.family == AF_INET6)
144 udpv6_encap_enable();
145#endif
146 usk->sk_error_report = rxrpc_error_report;
147
125 /* if a local address was supplied then bind it */ 148 /* if a local address was supplied then bind it */
126 if (local->srx.transport_len > sizeof(sa_family_t)) { 149 if (local->srx.transport_len > sizeof(sa_family_t)) {
127 _debug("bind"); 150 _debug("bind");
@@ -191,11 +214,6 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net)
191 BUG(); 214 BUG();
192 } 215 }
193 216
194 /* set the socket up */
195 sock = local->socket->sk;
196 sock->sk_user_data = local;
197 sock->sk_data_ready = rxrpc_data_ready;
198 sock->sk_error_report = rxrpc_error_report;
199 _leave(" = 0"); 217 _leave(" = 0");
200 return 0; 218 return 0;
201 219