Skip to content

Commit

Permalink
Merge pull request #81 from Climax777/master
Browse files Browse the repository at this point in the history
Fixes #76
  • Loading branch information
Samir committed Nov 6, 2015
2 parents d392b82 + 64f8ad1 commit 0d88e11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -103,6 +103,7 @@ OBJS=xl2tpd.o pty.o misc.o control.o avp.o call.o network.o avpsend.o scheduler.
SRCS=${OBJS:.o=.c} ${HDRS}
CONTROL_SRCS=xl2tpd-control.c
#LIBS= $(OSLIBS) # -lefence # efence for malloc checking
LDLIBS= -lm
EXEC=xl2tpd
CONTROL_EXEC=xl2tpd-control

Expand Down
6 changes: 4 additions & 2 deletions network.c
Expand Up @@ -30,6 +30,8 @@
#include "ipsecmast.h"
#include "misc.h" /* for IPADDY macro */

#include <math.h>

char hostname[256];
struct sockaddr_in server, from; /* Server and transmitter structs */
int server_socket; /* Server socket */
Expand Down Expand Up @@ -264,9 +266,9 @@ void control_xmit (void *b)
else
{
/*
* FIXME: How about adaptive timeouts?
* Adaptive timeout with exponential backoff
*/
tv.tv_sec = 1;
tv.tv_sec = 1*pow(2, buf->retries-1);
tv.tv_usec = 0;
schedule (tv, control_xmit, buf);
#ifdef DEBUG_CONTROL_XMIT
Expand Down

0 comments on commit 0d88e11

Please sign in to comment.