summary refs log tree commit diff
path: root/net/x25/af_x25.c
diff options
context:
space:
mode:
authorMartin Schiller <ms@dev.tdt.de>2019-12-09 08:21:34 +0100
committerDavid S. Miller <davem@davemloft.net>2019-12-09 10:28:43 -0800
commitf8fc57e8d7c5d95f4180b127d3b167de403557c0 (patch)
tree3392dd67387bbf32f8fd944006d43fa1181a7b29 /net/x25/af_x25.c
parent65cb13986229cec02635a1ecbcd1e2dd18353201 (diff)
downloadlinux-f8fc57e8d7c5d95f4180b127d3b167de403557c0.tar.gz
net/x25: add new state X25_STATE_5
This is needed, because if the flag X25_ACCPT_APPRV_FLAG is not set on a
socket (manual call confirmation) and the channel is cleared by remote
before the manual call confirmation was sent, this situation needs to
be handled.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/x25/af_x25.c')
-rw-r--r--net/x25/af_x25.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index c34f7d077604..2efe44a34644 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -659,6 +659,12 @@ static int x25_release(struct socket *sock)
 			sock_set_flag(sk, SOCK_DEAD);
 			sock_set_flag(sk, SOCK_DESTROY);
 			break;
+
+		case X25_STATE_5:
+			x25_write_internal(sk, X25_CLEAR_REQUEST);
+			x25_disconnect(sk, 0, 0, 0);
+			__x25_destroy_socket(sk);
+			goto out;
 	}
 
 	sock_orphan(sk);
@@ -1054,6 +1060,8 @@ int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb,
 	if (test_bit(X25_ACCPT_APPRV_FLAG, &makex25->flags)) {
 		x25_write_internal(make, X25_CALL_ACCEPTED);
 		makex25->state = X25_STATE_3;
+	} else {
+		makex25->state = X25_STATE_5;
 	}
 
 	/*