aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2024-01-21 19:40:06 +0000
committerOmar Polo <op@omarpolo.com>2024-01-21 19:40:06 +0000
commit83a2644bfb1d8683faf024275a98600b0edc5063 (patch)
treeea0783914312c1cf661315acd15ef787ad24b85c /config.c
parent4f3b85e6d72b0df0b6264baf711290af4661807d (diff)
convert remaining code to the imsg getters
Now gmid doesn't touch anymore the internals of the imsg structs.
Diffstat (limited to 'config.c')
-rw-r--r--config.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/config.c b/config.c
index 14ef23d..c793b26 100644
--- a/config.c
+++ b/config.c
@@ -479,9 +479,9 @@ config_crypto_recv_kp(struct conf *conf, struct imsg *imsg)
/* XXX: check for duplicates */
if ((fd = imsg_get_fd(imsg)) == -1)
- fatalx("no fd for imsg %d", imsg->hdr.type);
+ fatalx("%s: no fd for imsg %d", __func__, imsg_get_type(imsg));
- switch (imsg->hdr.type) {
+ switch (imsg_get_type(imsg)) {
case IMSG_RECONF_CERT:
if (pki != NULL)
fatalx("imsg in wrong order; pki is not NULL");
@@ -497,8 +497,8 @@ config_crypto_recv_kp(struct conf *conf, struct imsg *imsg)
case IMSG_RECONF_KEY:
if (pki == NULL)
- fatalx("got key without cert beforehand %d",
- imsg->hdr.type);
+ fatalx("%s: RECONF_KEY: got key without cert",
+ __func__);
if (load_file(fd, &d, &len) == -1)
fatalx("failed to load private key");
if ((pki->pkey = ssl_load_pkey(d, len)) == NULL)
@@ -533,7 +533,7 @@ config_recv(struct conf *conf, struct imsg *imsg)
size_t len;
int fd;
- switch (imsg->hdr.type) {
+ switch (imsg_get_type(imsg)) {
case IMSG_RECONF_START:
config_purge(conf);
h = NULL;