-/* $OpenBSD: config.c,v 1.96 2024/02/13 12:25:11 tobhe Exp $ */
+/* $OpenBSD: config.c,v 1.97 2024/02/15 19:11:00 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
event_set(&sock->sock_ev, sock->sock_fd,
EV_READ|EV_PERSIST, cb, sock);
- event_add(&sock->sock_ev, NULL);
return (0);
}
+void
+config_enablesocket(struct iked *env)
+{
+ struct iked_socket *sock;
+ size_t i;
+
+ for (i = 0; i < nitems(env->sc_sock4); i++)
+ if ((sock = env->sc_sock4[i]) != NULL)
+ event_add(&sock->sock_ev, NULL);
+ for (i = 0; i < nitems(env->sc_sock6); i++)
+ if ((sock = env->sc_sock6[i]) != NULL)
+ event_add(&sock->sock_ev, NULL);
+}
+
int
config_setpfkey(struct iked *env)
{
-/* $OpenBSD: iked.h,v 1.227 2024/02/15 19:04:12 tobhe Exp $ */
+/* $OpenBSD: iked.h,v 1.228 2024/02/15 19:11:00 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
enum privsep_procid);
int config_getsocket(struct iked *env, struct imsg *,
void (*cb)(int, short, void *));
+void config_enablesocket(struct iked *env);
int config_setpfkey(struct iked *);
int config_getpfkey(struct iked *, struct imsg *);
int config_setuser(struct iked *, struct iked_user *, enum privsep_procid);
-/* $OpenBSD: ikev2.c,v 1.383 2024/01/24 10:09:07 tobhe Exp $ */
+/* $OpenBSD: ikev2.c,v 1.384 2024/02/15 19:11:00 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
case IMSG_CTL_PASSIVE:
if (config_getmode(env, imsg->hdr.type) == -1)
return (0); /* ignore error */
+ config_enablesocket(env);
timer_del(env, &env->sc_inittmr);
TAILQ_FOREACH(pol, &env->sc_policies, pol_entry) {
if (policy_generate_ts(pol) == -1)