Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send a keep alive signal every second to keep UDP tunnels from collapsin... #45

Open
wants to merge 6 commits into
base: 1.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions doc/mtu_state_machine.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
digraph finite_state_machine {

node [shape = doublecircle];
start [ label = "start" ];

node [shape = circle];
probes [ label = "probing" ];
w_probes [ label = "waiting\nfor probes" ];

ping [ label = "pinging" ];
w_ping [ label = "wait ping\ninterval" ];
to_ping [ label = "ping\ntimeout" ];

start -> probes [ label = "/counter = 0 && minmtu = 0" ];
probes -> w_probes [ label = "/send burst\n&& counter++" ];
w_probes -> probes [ label = "1 second passes/" ];
w_probes -> w_probes [ label = "received probe/set minmtu" ];
probes -> ping [ label = "counter >= 10\n&& !minmtu/" ];
probes -> ping [ label = "counter < 30\n&& minmtu >= maxmtu\n|| counter == 30/set mtu" ];

ping -> to_ping [ label = "/send burst" ];
w_ping -> ping [ label = "ping interval passes/" ];
to_ping -> w_ping [ label = "ping timeout passes\n&& !minmtu/" ];
to_ping -> start [ label = "ping timeout passes\n&& minmtu/", weight = 2 ];
to_ping -> w_ping [ label = "ping received/\nset minmtu" ];
to_ping -> probes [ label = "ping received\n&& ping mtu > maxmtu/\ncounter = 10\n&& maxmtu = MTU" ];
w_ping -> probes [ label = "ping received\n&& ping mtu > maxmtu/\ncounter = 10\n&& maxmtu = MTU" ];
w_ping -> w_ping [ label = "ping received/\nset minmtu" ];
}

Binary file added doc/mtu_state_machine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ splay_tree_t *config_tree;

int pinginterval = 0; /* seconds between pings */
int pingtimeout = 0; /* seconds to wait for response */
int keepaliveinterval = 0; /* seconds between keep alive packets */
list_t *cmdline_conf = NULL; /* global/host configuration values given at the command line */

static int config_compare(const config_t *a, const config_t *b) {
Expand Down
1 change: 1 addition & 0 deletions src/conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern splay_tree_t *config_tree;

extern int pinginterval;
extern int pingtimeout;
extern int keepaliveinterval;
extern int maxtimeout;
extern bool bypass_security;
extern list_t *cmdline_conf;
Expand Down
1 change: 1 addition & 0 deletions src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ extern bool node_read_ecdsa_public_key(struct node_t *);
extern bool read_ecdsa_public_key(struct connection_t *);
extern bool read_rsa_public_key(struct connection_t *);
extern void send_mtu_probe(struct node_t *);
extern void create_mtu_probe(vpn_packet_t *, int *);
extern void handle_device_data(void *, int);
extern void handle_meta_connection_data(struct connection_t *);
extern void regenerate_key(void);
Expand Down
Loading