summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/table.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2018-05-24 11:38:25 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2018-05-24 11:38:25 +0000
commitace804cafcf33d9452774666bb47840ac1899bd0 (patch)
tree1b3ee00426c097326c9b50cc3bc062f20c89b0f9 /usr.sbin/smtpd/table.c
parentb22354e5b6362967535adf6c2e0d2c0d978e6ee0 (diff)
switch smtpd to new grammar
ok eric@
Diffstat (limited to 'usr.sbin/smtpd/table.c')
-rw-r--r--usr.sbin/smtpd/table.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/table.c b/usr.sbin/smtpd/table.c
index afb71788feb..ca4318e7bb6 100644
--- a/usr.sbin/smtpd/table.c
+++ b/usr.sbin/smtpd/table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table.c,v 1.24 2017/05/01 09:29:07 gilles Exp $ */
+/* $OpenBSD: table.c,v 1.25 2018/05/24 11:38:24 gilles Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -621,6 +621,11 @@ table_parse_lookup(enum table_service service, const char *key,
return (-1);
return (1);
+ case K_RELAYHOST:
+ if (!text_to_relayhost(&lk->relayhost, line))
+ return (-1);
+ return (1);
+
default:
return (-1);
}
@@ -693,6 +698,13 @@ table_dump_lookup(enum table_service s, union lookup *lk)
goto err;
break;
+ case K_RELAYHOST:
+ ret = snprintf(buf, sizeof(buf), "%s",
+ relayhost_to_text(&lk->relayhost));
+ if (ret == -1 || (size_t)ret >= sizeof (buf))
+ goto err;
+ break;
+
default:
(void)strlcpy(buf, "???", sizeof(buf));
break;