summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/mta_session.c
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2013-07-19 07:37:30 +0000
committerEric Faurot <eric@cvs.openbsd.org>2013-07-19 07:37:30 +0000
commit0d38b94a2cd827c21ab8cb80bc122b39b2188f0b (patch)
treea3845b9ee62bae53393ceb81c63236f3e3d4f7dd /usr.sbin/smtpd/mta_session.c
parent282de90e82121bc324891aba717c90857e61d4ad (diff)
get rid of sa_set_port() and its awfully contorted implementation
Diffstat (limited to 'usr.sbin/smtpd/mta_session.c')
-rw-r--r--usr.sbin/smtpd/mta_session.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/mta_session.c b/usr.sbin/smtpd/mta_session.c
index 9a6d12e6288..a5a00d6823c 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.37 2013/06/03 16:04:03 eric Exp $ */
+/* $OpenBSD: mta_session.c,v 1.38 2013/07/19 07:37:29 eric Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -479,7 +479,11 @@ mta_connect(struct mta_session *s)
memmove(&ss, s->route->dst->sa, s->route->dst->sa->sa_len);
sa = (struct sockaddr *)&ss;
- sa_set_port(sa, portno);
+
+ if (sa->sa_family == AF_INET)
+ ((struct sockaddr_in *)sa)->sin_port = htons(portno);
+ else if (sa->sa_family == AF_INET6)
+ ((struct sockaddr_in6 *)sa)->sin6_port = htons(portno);
s->attempt += 1;