File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ static const char *config_def_udp_port(void)
349349
350350static const char * config_def_dpd_idle (void )
351351{
352- return "300 " ;
352+ return "600 " ;
353353}
354354
355355static const char * config_ca_dir (void )
Original file line number Diff line number Diff line change @@ -955,7 +955,7 @@ static void vpnc_main_loop(struct sa_block *s)
955955 time_t now = time (NULL );
956956 if (s -> ike .dpd_seqno != s -> ike .dpd_seqno_ack ) {
957957 /* Wake up more often for dpd attempts */
958- select_timeout .tv_sec = 5 ;
958+ select_timeout .tv_sec = s -> ike . dpd_idle / 10 ;
959959 select_timeout .tv_usec = 0 ;
960960 dpd_ike (s );
961961 next_ike_dpd = now + s -> ike .dpd_idle ;
@@ -1029,8 +1029,8 @@ static void vpnc_main_loop(struct sa_block *s)
10291029 if (s -> ike .dpd_seqno != s -> ike .dpd_seqno_ack ) {
10301030 dpd_ike (s );
10311031 next_ike_dpd = now + s -> ike .dpd_idle ;
1032- if (now + 5 < next_up )
1033- next_up = now + 5 ;
1032+ if (now + s -> ike . dpd_idle / 10 < next_up )
1033+ next_up = now + s -> ike . dpd_idle / 10 ;
10341034 }
10351035 else if (now >= next_ike_dpd ) {
10361036 dpd_ike (s );
Original file line number Diff line number Diff line change @@ -801,20 +801,22 @@ void dpd_ike(struct sa_block *s)
801801 send_dpd (s , 0 , s -> ike .dpd_seqno );
802802 } else {
803803 /* Our last dpd request has not yet been acked. If it's been
804- ** less than 5 seconds since we sent it do nothing. Otherwise
804+ ** less than 1/10th of idle timeout since we sent it do nothing. Otherwise
805805 ** decrement dpd_attempts. If dpd_attempts is 0 dpd fails and we
806806 ** terminate otherwise we send it again with the same sequence
807807 ** number and record current time.
808808 */
809809 time_t now = time (NULL );
810- if (now < s -> ike .dpd_sent + 5 )
810+ if (now < s -> ike .dpd_sent + s -> ike . dpd_idle / 10 )
811811 return ;
812812 if (-- s -> ike .dpd_attempts == 0 ) {
813813 DEBUG (2 , printf ("dead peer detected, terminating\n" ));
814814 do_kill = -2 ;
815815 return ;
816816 }
817817 s -> ike .dpd_sent = now ;
818+ if (s -> ike .dpd_attempts == 3 )
819+ ++ s -> ike .dpd_seqno ; /* maybe just the dpd reply got lost let's try new seq no */
818820 send_dpd (s , 0 , s -> ike .dpd_seqno );
819821 }
820822 DEBUG (3 , printf ("sent DPD packet\n" ));
You can’t perform that action at this time.
0 commit comments