diff options
author | Renato Westphal <renato@cvs.openbsd.org> | 2016-05-23 18:35:11 +0000 |
---|---|---|
committer | Renato Westphal <renato@cvs.openbsd.org> | 2016-05-23 18:35:11 +0000 |
commit | e20a03db287c83c833556d124aafc7811d7aac86 (patch) | |
tree | 9d210bd09bbca1397f4f551094a847c6c3aab8c6 /usr.sbin | |
parent | e4eb5f4eb37fa71c6866ffa2a34b9854bfbf9402 (diff) |
Add an exception for kernels built without PFKEYv2 support.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ldpd/ldpe.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/usr.sbin/ldpd/ldpe.c b/usr.sbin/ldpd/ldpe.c index 98f2a519b5f..8db90f700be 100644 --- a/usr.sbin/ldpd/ldpe.c +++ b/usr.sbin/ldpd/ldpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpe.c,v 1.51 2016/05/23 18:33:56 renato Exp $ */ +/* $OpenBSD: ldpe.c,v 1.52 2016/05/23 18:35:10 renato Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -151,9 +151,11 @@ ldpe(struct ldpd_conf *xconf, int pipe_parent2ldpe[2], int pipe_ldpe2lde[2], iev_main->handler, iev_main); event_add(&iev_main->ev, NULL); - event_set(&pfkey_ev, global.pfkeysock, EV_READ | EV_PERSIST, - ldpe_dispatch_pfkey, NULL); - event_add(&pfkey_ev, NULL); + if (sysdep.no_pfkey == 0) { + event_set(&pfkey_ev, global.pfkeysock, EV_READ | EV_PERSIST, + ldpe_dispatch_pfkey, NULL); + event_add(&pfkey_ev, NULL); + } /* mark sockets as closed */ global.ldp_disc_socket = -1; @@ -182,9 +184,10 @@ ldpe_shutdown(void) control_cleanup(); config_clear(leconf); - event_del(&pfkey_ev); - close(global.pfkeysock); - + if (sysdep.no_pfkey == 0) { + event_del(&pfkey_ev); + close(global.pfkeysock); + } ldpe_close_sockets(); /* remove addresses from global list */ |