diff options
-rw-r--r-- | libexec/ftpd/monitor.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libexec/ftpd/monitor.c b/libexec/ftpd/monitor.c index 77eb2b78cb8..9983dc010da 100644 --- a/libexec/ftpd/monitor.c +++ b/libexec/ftpd/monitor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor.c,v 1.19 2009/06/04 01:10:34 sthen Exp $ */ +/* $OpenBSD: monitor.c,v 1.20 2009/06/04 01:12:39 sthen Exp $ */ /* * Copyright (c) 2004 Moritz Jodeit <moritz@openbsd.org> @@ -254,7 +254,7 @@ handle_cmds(void) int err, s, slavequit, serrno, domain; pid_t preauth_slave_pid; size_t len; - struct sockaddr sa; + union sockunion sa; socklen_t salen; char *name, *pw; @@ -359,18 +359,19 @@ handle_cmds(void) recv_data(fd_slave, &salen, sizeof(salen)); if (salen == 0 || salen > sizeof(sa)) - fatalx("monitor received invalid sockaddr len %u"); + fatalx("monitor received invalid sockaddr len"); bzero(&sa, sizeof(sa)); recv_data(fd_slave, &sa, salen); - if (sa.sa_len != salen) - fatalx("monitor received invalid sockaddr len %u/%u",sa.sa_len,sa.su_si.si_len); + if (sa.su_si.si_len != salen) + fatalx("monitor received invalid sockaddr len"); - if (sa.sa_family != AF_INET && sa.sa_family != AF_INET6) + if (sa.su_si.si_family != AF_INET && + sa.su_si.si_family != AF_INET6) fatalx("monitor received invalid addr family"); - err = bind(s, &sa, salen); + err = bind(s, (struct sockaddr *)&sa, salen); serrno = errno; if (s >= 0) |