diff options
author | David S. Miller <davem@davemloft.net> | 2018-10-13 00:38:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-13 00:38:46 -0400 |
commit | d864991b220b7c62e81d21209e1fd978fd67352c (patch) | |
tree | b570a1ad6fc1b959c5bcda6ceca0b321319c01e0 /net/rxrpc/local_object.c | |
parent | a688c53a0277d8ea21d86a5c56884892e3442c5e (diff) | |
parent | bab5c80b211035739997ebd361a679fa85b39465 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts were easy to resolve using immediate context mostly,
except the cls_u32.c one where I simply too the entire HEAD
chunk.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rxrpc/local_object.c')
-rw-r--r-- | net/rxrpc/local_object.c | 30 |
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 | */ |
109 | static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net) | 110 | static 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 | ||