summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2004-10-15 01:58:05 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2004-10-15 01:58:05 +0000
commit391edb8727095220b992c02596a079b6dabbf291 (patch)
tree7839280d3e880ff8267dbcada2c00fd21e09fac3 /usr.sbin
parent19b3fb890fa96960f5757b70073867c578677740 (diff)
Only set IPTOS_LOWDELAY on IPv4 interfaces; pointed out by phessler, ok henning
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ntpd/client.c6
-rw-r--r--usr.sbin/ntpd/server.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/ntpd/client.c b/usr.sbin/ntpd/client.c
index 100e5de840c..a3d4bb7a61f 100644
--- a/usr.sbin/ntpd/client.c
+++ b/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 <henning@openbsd.org>
@@ -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/usr.sbin/ntpd/server.c b/usr.sbin/ntpd/server.c
index 1d8e4d58932..c9228e79b2d 100644
--- a/usr.sbin/ntpd/server.c
+++ b/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 <henning@openbsd.org>
@@ -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,