Lines 584-592
Link Here
|
584 |
hp = gethostbyname (host); |
584 |
hp = gethostbyname (host); |
585 |
if (!hp) |
585 |
if (!hp) |
586 |
{ |
586 |
{ |
587 |
l2tp_log (LOG_WARNING, "Host name lookup failed for %s.\n", |
587 |
if ( lac->redial ) |
588 |
host); |
588 |
{ |
589 |
return NULL; |
589 |
int imax=lac->rmax; |
|
|
590 |
if ( lac->rmax == 0 ) |
591 |
imax = 1; |
592 |
while ( imax > 0 ) |
593 |
{ |
594 |
hp = gethostbyname ( host ); |
595 |
if ( hp ) |
596 |
break; |
597 |
l2tp_log ( LOG_WARNING, "Y: Host name lookup failed for %s. Trying to look again in %d seconds.\n", host, lac->rtimeout ); |
598 |
if ( lac->rtimeout > 0 ) |
599 |
sleep ( lac->rtimeout ); |
600 |
if ( lac->rmax > 0 ) |
601 |
imax--; |
602 |
} |
603 |
if ( ( imax == 0 ) && ( lac->rmax > 0 ) ) |
604 |
{ |
605 |
l2tp_log ( LOG_WARNING, "Y: Host name lookup failed for %s after %d tries. Lookup stops now.\n", host, lac->rmax ); |
606 |
return NULL; |
607 |
} |
608 |
} |
609 |
else |
610 |
{ |
611 |
l2tp_log (LOG_WARNING, "Host name lookup failed for %s.\n", host); |
612 |
return NULL; |
613 |
} |
590 |
} |
614 |
} |
591 |
bcopy (hp->h_addr, &addr, hp->h_length); |
615 |
bcopy (hp->h_addr, &addr, hp->h_length); |
592 |
/* Force creation of a new tunnel |
616 |
/* Force creation of a new tunnel |