The reason we need the interval timer is (a) to top up the entropy pool,
and (b) to clean up old keysets. If there are no peers, we do no key
exchange, so we don't need any random bits, and there are no keysets to
clear away. So we can save wakeups in this case.
For now, there are stub versions of `iv_(add|rm)reason' in `test.c', but
these will vanish once we split `main' out into its own file. (Spoiler
alert!)
T( trace(T_TUNNEL, "peer: attached interface %s to peer `%s'",
p->ifname, p_name(p)); )
p_setkatimer(p);
+ iv_addreason();
if (kx_setup(&p->kx, p, &p->ks, p->spec.f & PSF_KXMASK))
goto tidy_4;
a_notify("ADD",
if (spec->t_ka) sel_rmtimer(&p->tka);
xfree(p->ifname);
p->t->ops->destroy(p->t);
+ iv_rmreason();
tidy_3:
if (fd >= 0) close(fd);
tidy_2:
}
sym_remove(&byname, p->byname);
am_remove(&byaddr, p->byaddr);
+ iv_rmreason();
DESTROY(p);
}
static void lastarg(void)
{ if (*args) die(2, "unexpected argument `%s'", *args); }
+void iv_addreason(void) { ; }
+void iv_rmreason(void) { ; }
+
int main(int argc, char *argv[])
{
const char *kr = "keyring";
a_switcherr();
}
- iv_addreason();
-
lp_run();
return (0);
}