From 6f0aa2bc0d2309a080e85b5470f4e466b941a8dc Mon Sep 17 00:00:00 2001 From: Pierre-Yves Ritschard Date: Tue, 29 May 2007 23:19:19 +0000 Subject: allow the control handling code to send messages back to the parent. forward IMSG_CTL_RELOAD which ends up not doing anything for now. --- usr.sbin/relayd/relayd.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'usr.sbin/relayd/relayd.c') diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c index f7ac75092d8..10810254e13 100644 --- a/usr.sbin/relayd/relayd.c +++ b/usr.sbin/relayd/relayd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relayd.c,v 1.28 2007/05/29 18:59:53 pyr Exp $ */ +/* $OpenBSD: relayd.c,v 1.29 2007/05/29 23:19:18 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard @@ -241,10 +241,11 @@ main(int argc, char *argv[]) (ibuf_hce = calloc(1, sizeof(struct imsgbuf))) == NULL) fatal(NULL); - if (env->prefork_relay > 0 && - (ibuf_relay = calloc(env->prefork_relay, - sizeof(struct imsgbuf)) == NULL)) - fatal(NULL); + if (env->prefork_relay > 0) { + if ((ibuf_relay = calloc(env->prefork_relay, + sizeof(struct imsgbuf))) == NULL) + fatal(NULL); + } imsg_init(ibuf_pfe, pipe_parent2pfe[0], main_dispatch_pfe); imsg_init(ibuf_hce, pipe_parent2hce[0], main_dispatch_hce); @@ -474,6 +475,11 @@ main_dispatch_pfe(int fd, short event, void *ptr) memcpy(&demote, imsg.data, sizeof(demote)); carp_demote_set(demote.group, demote.level); break; + case IMSG_CTL_RELOAD: + /* + * so far we only get here if no L7 (relay) is done. + */ + break; default: log_debug("main_dispatch_pfe: unexpected imsg %d", imsg.hdr.type); -- cgit v1.2.3