aboutsummaryrefslogtreecommitdiffstats
path: root/main/ipsec-tools/initial-contact-fix.diff
blob: 370418be099d2e3fad0c94cb37f3a244cea6b83a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Index: src/racoon/admin.c
===================================================================
RCS file: /cvsroot/src/crypto/dist/ipsec-tools/src/racoon/admin.c,v
retrieving revision 1.32
diff -u -r1.32 admin.c
--- src/racoon/admin.c	3 Sep 2009 09:29:07 -0000	1.32
+++ src/racoon/admin.c	10 Dec 2009 14:38:47 -0000
@@ -299,9 +299,8 @@
 		break;
 
 	case ADMIN_DELETE_SA: {
-		struct ph1handle *iph1;
-		struct ph1selector sel;
 		char *loc, *rem;
+		struct ph1selector sel;
 
 		memset(&sel, 0, sizeof(sel));
 		sel.local = (struct sockaddr *)
@@ -319,6 +318,7 @@
 		plog(LLV_INFO, LOCATION, NULL,
 		     "admin delete-sa %s %s\n", loc, rem);
 		enumph1(&sel, admin_ph1_delete_sa, NULL);
+		remcontacted(sel.remote);
 
 		racoon_free(loc);
 		racoon_free(rem);
Index: src/racoon/handler.c
===================================================================
RCS file: /cvsroot/src/crypto/dist/ipsec-tools/src/racoon/handler.c,v
retrieving revision 1.31
diff -u -r1.31 handler.c
--- src/racoon/handler.c	22 Nov 2009 19:34:55 -0000	1.31
+++ src/racoon/handler.c	10 Dec 2009 14:38:48 -0000
@@ -966,6 +966,22 @@
 }
 
 void
+remcontacted(remote)
+	struct sockaddr *remote;
+{
+	struct contacted *p;
+
+	LIST_FOREACH(p, &ctdtree, chain) {
+		if (cmpsaddr(remote, p->remote) == 0) {
+			LIST_REMOVE(p, chain);
+			racoon_free(p->remote);
+			racoon_free(p);
+			break;
+		}
+	}	
+}
+
+void
 initctdtree()
 {
 	LIST_INIT(&ctdtree);
Index: src/racoon/handler.h
===================================================================
RCS file: /cvsroot/src/crypto/dist/ipsec-tools/src/racoon/handler.h,v
retrieving revision 1.22
diff -u -r1.22 handler.h
--- src/racoon/handler.h	3 Sep 2009 09:29:07 -0000	1.22
+++ src/racoon/handler.h	10 Dec 2009 14:38:48 -0000
@@ -518,6 +518,7 @@
 
 extern struct contacted *getcontacted __P((struct sockaddr *));
 extern int inscontacted __P((struct sockaddr *));
+extern void remcontacted __P((struct sockaddr *));
 extern void initctdtree __P((void));
 
 extern int check_recvdpkt __P((struct sockaddr *,