Browse Source

Use SA_LEN(sa) instead of sa->sa_len; ok henning@

OPENBSD_3_6
dtucker 20 years ago
parent
commit
e8355e306b
3 changed files with 7 additions and 7 deletions
  1. +2
    -2
      src/usr.sbin/ntpd/log.c
  2. +2
    -2
      src/usr.sbin/ntpd/ntp_msg.c
  3. +3
    -3
      src/usr.sbin/ntpd/server.c

+ 2
- 2
src/usr.sbin/ntpd/log.c View File

@ -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


+ 2
- 2
src/usr.sbin/ntpd/ntp_msg.c View File

@ -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);
}


+ 3
- 3
src/usr.sbin/ntpd/server.c View File

@ -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");
}


Loading…
Cancel
Save