diff options
Diffstat (limited to 'src/openvpn/ping-inline.h')
-rw-r--r-- | src/openvpn/ping-inline.h | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/openvpn/ping-inline.h b/src/openvpn/ping-inline.h index c724970..2fa1d5c 100644 --- a/src/openvpn/ping-inline.h +++ b/src/openvpn/ping-inline.h @@ -5,7 +5,7 @@ * packet encryption, packet authentication, and * packet compression. * - * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net> + * Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -30,30 +30,36 @@ * not received in n seconds? */ static inline void -check_ping_restart (struct context *c) +check_ping_restart(struct context *c) { - void check_ping_restart_dowork (struct context *c); - if (c->options.ping_rec_timeout - && event_timeout_trigger (&c->c2.ping_rec_interval, - &c->c2.timeval, - (!c->options.ping_timer_remote - || link_socket_actual_defined (&c->c1.link_socket_addr.actual)) - ? ETT_DEFAULT : 15)) - check_ping_restart_dowork (c); + void check_ping_restart_dowork(struct context *c); + + if (c->options.ping_rec_timeout + && event_timeout_trigger(&c->c2.ping_rec_interval, + &c->c2.timeval, + (!c->options.ping_timer_remote + || link_socket_actual_defined(&c->c1.link_socket_addr.actual)) + ? ETT_DEFAULT : 15)) + { + check_ping_restart_dowork(c); + } } /* * Should we ping the remote? */ static inline void -check_ping_send (struct context *c) +check_ping_send(struct context *c) { - void check_ping_send_dowork (struct context *c); - if (c->options.ping_send_timeout - && event_timeout_trigger (&c->c2.ping_send_interval, - &c->c2.timeval, - !TO_LINK_DEF(c) ? ETT_DEFAULT : 1)) - check_ping_send_dowork (c); + void check_ping_send_dowork(struct context *c); + + if (c->options.ping_send_timeout + && event_timeout_trigger(&c->c2.ping_send_interval, + &c->c2.timeval, + !TO_LINK_DEF(c) ? ETT_DEFAULT : 1)) + { + check_ping_send_dowork(c); + } } -#endif +#endif /* ifndef PING_INLINE_H */ |