Modify

Opened 5 years ago

Last modified 3 years ago

#12583 new defect

xl2tpd in some cases does not redial, but should

Reported by: Alexander Tyrin <greefon@…> Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Attitude Adjustment 12.09 Beta
Keywords: xl2tpd, redial, dns Cc:

Description

xl2tpd stops trying to connect if it can not resolve server name (DNS failure or WAN termporary unavailible), even if autodial and redial options are set

This patch solves the problem:

--- xl2tpd-1.3.1/xl2tpd.c.orig	2011-10-06 23:22:05.000000000 +0400
+++ xl2tpd-1.3.1/xl2tpd.c	2012-11-06 22:42:11.086671247 +0400
@@ -635,6 +635,14 @@
     {
         l2tp_log (LOG_WARNING, "Host name lookup failed for %s.\n",
              host);
+	if (lac->redial && (lac->rtimeout > 0) && !lac->rsched && lac->active)
+	{
+	    struct timeval tv;
+	    l2tp_log (LOG_INFO, "Will redial in %d seconds\n", lac->rtimeout);
+	    tv.tv_sec = lac->rtimeout;
+	    tv.tv_usec = 0;
+	    lac->rsched = schedule (tv, magic_lac_dial, lac);
+	}
         return NULL;
     }
     bcopy (hp->h_addr, &addr.s_addr, hp->h_length);

Attachments (0)

Change History (4)

comment:1 follow-up: Changed 5 years ago by dgolle@…

Redialing should rather be handled by netifd. Evaluating interface dependencies and setting up static routes may also require working name resolution, as well as the interfaces and routes it depends on being up.

comment:2 in reply to: ↑ 1 Changed 5 years ago by greefon <greefon@…>

Replying to dgolle@…:

Redialing should rather be handled by netifd. Evaluating interface dependencies and setting up static routes may also require working name resolution, as well as the interfaces and routes it depends on being up.

Sorry, I don't understand you completly.

Now /lib/netifd/proto/l2tp.sh uses this command to add l2tp connection:
xl2tpd-control add l2tp-${config} pppoptfile=${optfile} lns=${server} redial=yes redial timeout=20

So, xl2tpd already "by design" has redial in 20 sec after connection down. This work well for simple cases like "Connection reset by peer". However, if I temporary lose wan link - xl2tpd will give up (can't resolve DNS). This patch allow it to try again and again with configured interval. When my wan link comes back - xl2tpd will bring up my VPN.

comment:3 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

comment:4 Changed 3 years ago by anonymous

hey, jow.

can you please update when it's gonna be included in latest 14.07 ?

thanks.

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.