diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2018-10-18 01:43:51 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2018-10-18 01:43:51 +0000 |
commit | f170262f9a6d4a348fad3a142061cb0f35173856 (patch) | |
tree | 0deb5642479949878d60dfe52b0ca6c99092bd51 /sys/net | |
parent | 7ec27ebf39419a542f233f200b10189edb471ad7 (diff) |
move the timeout_add in gre_keepalive_send up.
gre_keepalive_send() should re-schedule immediately, otherwise we
stop sending keepalive on temporary mbuf shortage or if the
configuration is incomplete.
from markus@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_gre.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index c43344368fb..e880bfb03ea 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_gre.c,v 1.126 2018/10/18 01:36:26 dlg Exp $ */ +/* $OpenBSD: if_gre.c,v 1.127 2018/10/18 01:43:50 dlg Exp $ */ /* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */ /* @@ -2815,6 +2815,13 @@ gre_keepalive_send(void *arg) uint16_t proto; uint8_t ttl; + /* + * re-schedule immediately, so we deal with incomplete configuation + * or temporary errors. + */ + if (sc->sc_ka_timeo) + timeout_add_sec(&sc->sc_ka_send, sc->sc_ka_timeo); + if (!ISSET(sc->sc_if.if_flags, IFF_RUNNING) || sc->sc_ka_state == GRE_KA_NONE || sc->sc_tunnel.t_rtableid != sc->sc_if.if_rdomain) @@ -2898,8 +2905,6 @@ gre_keepalive_send(void *arg) return; gre_ip_output(&sc->sc_tunnel, m); - - timeout_add_sec(&sc->sc_ka_send, sc->sc_ka_timeo); } static void |