diff --git a/src/usr.sbin/ntpd/client.c b/src/usr.sbin/ntpd/client.c index 100e5de8..a3d4bb7a 100644 --- a/src/usr.sbin/ntpd/client.c +++ b/src/usr.sbin/ntpd/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.41 2004/10/14 09:35:48 dtucker Exp $ */ +/* $OpenBSD: client.c,v 1.42 2004/10/15 01:58:04 dtucker Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -133,8 +133,8 @@ client_query(struct ntp_peer *p) } else fatal("client_query connect"); } - if (setsockopt(p->query->fd, IPPROTO_IP, IP_TOS, &tos, - sizeof(tos)) == -1) + if (p->addr->ss.ss_family == AF_INET && setsockopt(p->query->fd, + IPPROTO_IP, IP_TOS, &tos, sizeof(tos)) == -1) log_warn("setsockopt IPTOS_LOWDELAY"); } diff --git a/src/usr.sbin/ntpd/server.c b/src/usr.sbin/ntpd/server.c index 1d8e4d58..c9228e79 100644 --- a/src/usr.sbin/ntpd/server.c +++ b/src/usr.sbin/ntpd/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.16 2004/10/14 09:35:48 dtucker Exp $ */ +/* $OpenBSD: server.c,v 1.17 2004/10/15 01:58:04 dtucker Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -83,8 +83,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 (setsockopt(la->fd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos)) - == -1) + if (la->sa.ss_family == AF_INET && setsockopt(la->fd, + IPPROTO_IP, IP_TOS, &tos, sizeof(tos)) == -1) log_warn("setsockopt IPTOS_LOWDELAY"); if (bind(la->fd, (struct sockaddr *)&la->sa,