diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2004-11-05 23:39:47 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2004-11-05 23:39:47 +0000 |
commit | e8427d11cbca3f973bbc3d6efad7f3c9f24ec37c (patch) | |
tree | d35e7f466e6fc515e7c3ce54282f170c54d95367 | |
parent | aef62771653f48d333f9cd7448a014b7c2b3174b (diff) |
Use SA_LEN() instead of ss.ss_len. Evaluates to the same result but it's
easier on portable. ok henning@
-rw-r--r-- | usr.sbin/ntpd/client.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/ntpd/client.c b/usr.sbin/ntpd/client.c index 28bad9ffeee..4c19e421a0a 100644 --- a/usr.sbin/ntpd/client.c +++ b/usr.sbin/ntpd/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.43 2004/10/22 21:17:37 henning Exp $ */ +/* $OpenBSD: client.c,v 1.44 2004/11/05 23:39:46 dtucker Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -120,11 +120,12 @@ client_query(struct ntp_peer *p) } if (p->query->fd == -1) { + struct sockaddr *sa = (struct sockaddr *)&p->addr->ss; + if ((p->query->fd = socket(p->addr->ss.ss_family, SOCK_DGRAM, 0)) == -1) fatal("client_query socket"); - if (connect(p->query->fd, (struct sockaddr *)&p->addr->ss, - p->addr->ss.ss_len) == -1) { + if (connect(p->query->fd, sa, SA_LEN(sa)) == -1) { if (errno == ECONNREFUSED || errno == ENETUNREACH || errno == EHOSTUNREACH) { client_nextaddr(p); |