From ceecbd1877571b69b2e9b6164093d6c01875caf0 Mon Sep 17 00:00:00 2001 From: dtucker <> Date: Fri, 5 Nov 2004 23:39:46 +0000 Subject: [PATCH] Use SA_LEN() instead of ss.ss_len. Evaluates to the same result but it's easier on portable. ok henning@ --- src/usr.sbin/ntpd/client.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/usr.sbin/ntpd/client.c b/src/usr.sbin/ntpd/client.c index 28bad9ff..4c19e421 100644 --- a/src/usr.sbin/ntpd/client.c +++ b/src/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 @@ -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);