summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2004-07-11 03:05:51 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2004-07-11 03:05:51 +0000
commitb8ef89e7f0123d7116e107a465c05f1fb210dc29 (patch)
tree08405e2536d763e18d6ac044519cb15b49da00b9
parent71e3df895b17d68f1ba03f499506e23449bfc760 (diff)
Use SA_LEN(sa) instead of sa->sa_len; ok henning@
-rw-r--r--usr.sbin/ntpd/log.c4
-rw-r--r--usr.sbin/ntpd/ntp_msg.c4
-rw-r--r--usr.sbin/ntpd/server.c6
3 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/ntpd/log.c b/usr.sbin/ntpd/log.c
index e621fdd911c..40acc044dff 100644
--- a/usr.sbin/ntpd/log.c
+++ b/usr.sbin/ntpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.4 2004/07/08 01:19:27 henning Exp $ */
+/* $OpenBSD: log.c,v 1.5 2004/07/11 03:05:50 dtucker Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -163,7 +163,7 @@ log_sockaddr(struct sockaddr *sa)
{
static char buf[NI_MAXHOST];
- if (getnameinfo(sa, sa->sa_len, buf, sizeof(buf), NULL, 0,
+ if (getnameinfo(sa, SA_LEN(sa), buf, sizeof(buf), NULL, 0,
NI_NUMERICHOST))
return ("(unknown)");
else
diff --git a/usr.sbin/ntpd/ntp_msg.c b/usr.sbin/ntpd/ntp_msg.c
index eee25694011..f96edb01ad2 100644
--- a/usr.sbin/ntpd/ntp_msg.c
+++ b/usr.sbin/ntpd/ntp_msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp_msg.c,v 1.3 2004/07/09 15:02:15 henning Exp $ */
+/* $OpenBSD: ntp_msg.c,v 1.4 2004/07/11 03:05:50 dtucker Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -135,7 +135,7 @@ ntp_sendmsg(int fd, struct sockaddr *sa, struct ntp_msg *msg, ssize_t len,
/* XXX */
}
- if (sendto(fd, &buf, len, 0, sa, sa->sa_len) != len) {
+ if (sendto(fd, &buf, len, 0, sa, SA_LEN(sa)) != len) {
log_warn("sendto");
return (-1);
}
diff --git a/usr.sbin/ntpd/server.c b/usr.sbin/ntpd/server.c
index 36c4cfd995d..ea202f6ce18 100644
--- a/usr.sbin/ntpd/server.c
+++ b/usr.sbin/ntpd/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.7 2004/07/07 07:32:05 alexander Exp $ */
+/* $OpenBSD: server.c,v 1.8 2004/07/11 03:05:50 dtucker Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -81,8 +81,8 @@ setup_listeners(struct servent *se, struct ntpd_conf *conf, u_int *cnt)
if ((la->fd = socket(la->sa.ss_family, SOCK_DGRAM, 0)) == -1)
fatal("socket");
- if (bind(la->fd, (struct sockaddr *)&la->sa, la->sa.ss_len) ==
- -1)
+ if (bind(la->fd, (struct sockaddr *)&la->sa,
+ SA_LEN((struct sockaddr *)&la->sa)) == -1)
fatal("bind");
}