]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From: Gerald Schaefer <geraldsc@de.ibm.com> |
2 | Subject: af_iucv: avoid left over IUCV connections from failing connects | |
3 | References: bnc#514644,LTC#52270 | |
4 | ||
5 | Symptom: extra unused IUCV connections left around | |
6 | Problem: For certain types of AFIUCV socket connect failures | |
7 | connection cleanup is insufficient resulting in | |
8 | left over IUCV connections. | |
9 | Solution: Add some cleanup-statements to avoid cluttered IUCV | |
10 | connections. | |
11 | ||
12 | Acked-by: John Jolly <jjolly@suse.de> | |
13 | --- | |
14 | net/iucv/af_iucv.c | 10 ++++++++-- | |
15 | 1 file changed, 8 insertions(+), 2 deletions(-) | |
16 | ||
17 | Index: linux-sles11/net/iucv/af_iucv.c | |
18 | =================================================================== | |
19 | --- linux-sles11.orig/net/iucv/af_iucv.c | |
20 | +++ linux-sles11/net/iucv/af_iucv.c | |
21 | @@ -503,9 +503,15 @@ static int iucv_sock_connect(struct sock | |
22 | } | |
23 | ||
24 | if (sk->sk_state == IUCV_DISCONN) { | |
25 | - release_sock(sk); | |
26 | - return -ECONNREFUSED; | |
27 | + err = -ECONNREFUSED; | |
28 | } | |
29 | + | |
30 | + if (err) { | |
31 | + iucv_path_sever(iucv->path, NULL); | |
32 | + iucv_path_free(iucv->path); | |
33 | + iucv->path = NULL; | |
34 | + } | |
35 | + | |
36 | done: | |
37 | release_sock(sk); | |
38 | return err; |