summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/mta_session.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/smtpd/mta_session.c')
-rw-r--r--usr.sbin/smtpd/mta_session.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/smtpd/mta_session.c b/usr.sbin/smtpd/mta_session.c
index fa7c7e1ce0d..d384692a0e4 100644
--- a/usr.sbin/smtpd/mta_session.c
+++ b/usr.sbin/smtpd/mta_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta_session.c,v 1.135 2020/04/24 11:34:07 eric Exp $ */
+/* $OpenBSD: mta_session.c,v 1.136 2020/05/21 15:38:05 millert Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -1809,21 +1809,25 @@ mta_filter_end(struct mta_session *s)
static void
mta_connected(struct mta_session *s)
{
- struct sockaddr sa_src;
- struct sockaddr sa_dest;
+ struct sockaddr_storage sa_src;
+ struct sockaddr_storage sa_dest;
int sa_len;
log_info("%016"PRIx64" mta connected", s->id);
- if (getsockname(io_fileno(s->io), &sa_src, &sa_len) == -1)
+ sa_len = sizeof sa_src;
+ if (getsockname(io_fileno(s->io),
+ (struct sockaddr *)&sa_src, &sa_len) == -1)
bzero(&sa_src, sizeof sa_src);
- if (getpeername(io_fileno(s->io), &sa_dest, &sa_len) == -1)
+ sa_len = sizeof sa_dest;
+ if (getpeername(io_fileno(s->io),
+ (struct sockaddr *)&sa_dest, &sa_len) == -1)
bzero(&sa_dest, sizeof sa_dest);
mta_report_link_connect(s,
s->route->dst->ptrname, 1,
- (struct sockaddr_storage *)&sa_src,
- (struct sockaddr_storage *)&sa_dest);
+ &sa_src,
+ &sa_dest);
}
static void