12 #include <linux/module.h>
13 #include <linux/net.h>
15 #include <linux/errqueue.h>
16 #include <linux/udp.h>
18 #include <linux/in6.h>
19 #include <linux/icmp.h>
41 if (call->
state <= RXRPC_CALL_COMPLETE) {
44 if (state == RXRPC_CALL_LOCALLY_ABORTED)
74 if (conn->
state < RXRPC_CONN_REMOTELY_ABORTED) {
75 conn->
state = RXRPC_CONN_LOCALLY_ABORTED;
80 _leave(
" = 0 [already dead]");
84 rxrpc_abort_calls(conn, RXRPC_CALL_LOCALLY_ABORTED, abort_code);
86 msg.msg_name = &conn->
trans->peer->srx.transport.sin;
87 msg.msg_namelen =
sizeof(conn->
trans->peer->srx.transport.sin);
89 msg.msg_controllen = 0;
103 word =
htonl(abort_code);
105 iov[0].iov_base = &
hdr;
106 iov[0].iov_len =
sizeof(
hdr);
107 iov[1].iov_base = &
word;
108 iov[1].iov_len =
sizeof(
word);
110 len = iov[0].iov_len + iov[1].iov_len;
113 _proto(
"Tx CONN ABORT %%%u { %d }",
ntohl(
hdr.serial), abort_code);
117 _debug(
"sendmsg failed: %d", ret);
129 static void rxrpc_call_is_secure(
struct rxrpc_call *call)
134 if (call->
state < RXRPC_CALL_COMPLETE &&
153 if (conn->
state >= RXRPC_CONN_REMOTELY_ABORTED) {
162 switch (sp->
hdr.type) {
166 _proto(
"Rx ABORT %%%u { ac=%d }", serial,
ntohl(tmp));
168 conn->
state = RXRPC_CONN_REMOTELY_ABORTED;
169 rxrpc_abort_calls(conn, RXRPC_CALL_REMOTELY_ABORTED,
175 return conn->
security->respond_to_challenge(
176 conn, skb, _abort_code);
183 ret = conn->
security->verify_response(conn, skb, _abort_code);
187 ret = conn->
security->init_connection_security(conn);
191 conn->
security->prime_packet_security(conn);
195 if (conn->
state == RXRPC_CONN_SERVER_CHALLENGING) {
196 conn->
state = RXRPC_CONN_SERVER;
198 rxrpc_call_is_secure(conn->
channels[loop]);
224 _debug(
"set up security");
240 if (conn->
security->issue_challenge(conn) < 0) {
250 _debug(
"abort %d, %d", ret, abort_code);
251 rxrpc_abort_connection(conn, -ret, abort_code);
271 rxrpc_secure_connection(conn);
278 ret = rxrpc_process_event(conn, skb, &abort_code);
285 goto requeue_and_leave;
304 if (rxrpc_abort_connection(conn, -ret, abort_code) < 0)
305 goto requeue_and_leave;
320 printk(
"resurrected on reject\n");
355 size =
sizeof(
hdr) +
sizeof(code);
363 sa.sa.sa_family = local->
srx.transport.family;
364 switch (
sa.sa.sa_family) {
373 memset(&hdr, 0,
sizeof(hdr));
378 switch (
sa.sa.sa_family) {
380 sa.sin.sin_port = udp_hdr(skb)->source;
381 sa.sin.sin_addr.s_addr = ip_hdr(skb)->saddr;