
vpnc at unix-ag
Jun 24, 2008, 3:46 PM
Post #1 of 1
(147 views)
Permalink
|
|
svn commit: vpnc r330 - /trunk/vpnc.c
|
|
Author: Joerg Mayer Date: Wed Jun 25 00:46:50 2008 New Revision: 330 Log: Get rid of setup_link() Modified: trunk/vpnc.c Modified: trunk/vpnc.c ============================================================================== --- trunk/vpnc.c (original) +++ trunk/vpnc.c Wed Jun 25 00:46:50 2008 @@ -2864,21 +2864,10 @@ if (dh_public) free(dh_public); } -static void setup_link(struct sa_block *s) -{ - /* Set up the interface here so it's ready when our acknowledgement - * arrives. */ - DEBUGTOP(2, printf("S7.0 run interface setup script\n")); - - config_tunnel(s); - - do_phase2_qm(s); - DEBUGTOP(2, printf("S7.9 main loop (receive and transmit ipsec packets)\n")); - vpnc_doit(s); - - /* finished, send the delete messages - * 2007-08-31 JKU/ZID: Sonicwall doesn't like the chained - * request but wants them split. Cisco does fine with it */ +static void send_delete_ipsec(struct sa_block *s) +{ + /* 2007-08-31 JKU/ZID: Sonicwall doesn't like the chained + * request but wants them split. Cisco does fine with it. */ DEBUGTOP(2, printf("S7.10 send ipsec termination message\n")); { struct isakmp_payload *d_ipsec; @@ -2899,6 +2888,10 @@ del_msgid, 1, NULL, NULL, NULL, 0, NULL, 0); } +} + +static void send_delete_isakmp(struct sa_block *s) +{ DEBUGTOP(2, printf("S7.11 send isakmp termination message\n")); { struct isakmp_payload *d_isakmp; @@ -3267,9 +3260,21 @@ do_load_balance = do_phase2_config(s); } while (do_load_balance); DEBUGTOP(2, printf("S7 setup_link (phase 2 + main_loop)\n")); - setup_link(s); + DEBUGTOP(2, printf("S7.0 run interface setup script\n")); + config_tunnel(s); + do_phase2_qm(s); + DEBUGTOP(2, printf("S7.9 main loop (receive and transmit ipsec packets)\n")); + vpnc_doit(s); + + /* Tear down phase 2 and 1 tunnels */ + send_delete_ipsec(s); + send_delete_isakmp(s); + + /* Cleanup routing */ DEBUGTOP(2, printf("S8 close_tunnel\n")); close_tunnel(); + + /* Free resources */ DEBUGTOP(2, printf("S9 cleanup\n")); cleanup(s); _______________________________________________ vpnc-devel mailing list vpnc-devel[at]unix-ag.uni-kl.de https://lists.unix-ag.uni-kl.de/mailman/listinfo/vpnc-devel http://www.unix-ag.uni-kl.de/~massar/vpnc/
|