aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--smtpd/mfa_session.c2
-rw-r--r--smtpd/mta.c21
-rw-r--r--smtpd/smtp_session.c4
3 files changed, 6 insertions, 21 deletions
diff --git a/smtpd/mfa_session.c b/smtpd/mfa_session.c
index 32f97f93..c73b3d8c 100644
--- a/smtpd/mfa_session.c
+++ b/smtpd/mfa_session.c
@@ -509,7 +509,7 @@ mfa_filter_imsg(struct mproc *p, struct imsg *imsg)
q->state = (resp->status == MFA_OK) ? QUERY_READY : QUERY_DONE;
if (resp->notify)
- tree_xset(&q->notify, (uint64_t)(f), f);
+ tree_xset(&q->notify, (uintptr_t)(f), f);
next = TAILQ_NEXT(q, entry);
mfa_drain_query(q);
diff --git a/smtpd/mta.c b/smtpd/mta.c
index e4bc180c..192128c7 100644
--- a/smtpd/mta.c
+++ b/smtpd/mta.c
@@ -104,19 +104,6 @@ static const char *mta_route_to_text(struct mta_route *);
static int mta_route_cmp(const struct mta_route *, const struct mta_route *);
SPLAY_PROTOTYPE(mta_route_tree, mta_route, entry, mta_route_cmp);
-static inline uint64_t
-ptoid(void * p)
-{
- union {
- void *p;
- uint64_t v;
- } u;
-
- u.v = 0;
- u.p = p;
- return (u.v);
-}
-
static struct mta_relay_tree relays;
static struct mta_domain_tree domains;
static struct mta_host_tree hosts;
@@ -444,7 +431,7 @@ mta_source_error(struct mta_relay *relay, struct mta_route *route, const char *e
* Remember the source as broken for this relay. Take a reference if
* it's not already marked by another session.
*/
- if (tree_set(&relay->source_fail, ptoid(route->src), route->src) == NULL)
+ if (tree_set(&relay->source_fail, (uintptr_t)(route->src), route->src) == NULL)
mta_source_ref(route->src);
}
@@ -632,7 +619,6 @@ static void
mta_on_source(struct mta_relay *relay, struct mta_source *source)
{
struct mta_route *route;
- uint64_t id;
log_debug("debug: mta_on_source(%s, %s)",
mta_relay_to_text(relay), mta_source_to_text(source));
@@ -644,8 +630,7 @@ mta_on_source(struct mta_relay *relay, struct mta_source *source)
return;
}
- id = ptoid(source);
- if (tree_check(&relay->source_fail, id)) {
+ if (tree_check(&relay->source_fail, (uintptr_t)(source))) {
/*
* If this source has been tried already, and there is no
* active connection (which would mean that a source was found
@@ -913,7 +898,7 @@ mta_find_route(struct mta_relay *relay, struct mta_source *source)
/* Remember that this route is not useable */
mta_source_ref(source);
- tree_xset(&relay->source_fail, ptoid(source), source);
+ tree_xset(&relay->source_fail, (uintptr_t)(source), source);
return (NULL);
}
diff --git a/smtpd/smtp_session.c b/smtpd/smtp_session.c
index 286fbae5..322d0427 100644
--- a/smtpd/smtp_session.c
+++ b/smtpd/smtp_session.c
@@ -302,8 +302,8 @@ smtp_session_imsg(struct mproc *p, struct imsg *imsg)
case IMSG_MFA_SMTP_DATA:
resp_mfa_data = imsg->data;
- s = tree_xget(&wait_mfa_data, resp_mfa_data->reqid);
- smtp_mfa_data(s, resp_mfa_data->buffer);
+ if ((s = tree_get(&wait_mfa_data, resp_mfa_data->reqid)))
+ smtp_mfa_data(s, resp_mfa_data->buffer);
return;
case IMSG_MFA_SMTP_RESPONSE: