Browse Source

Only set IPTOS_LOWDELAY on IPv4 interfaces; pointed out by phessler, ok henning

OPENBSD_3_7
dtucker 20 years ago
parent
commit
3b0155d86c
2 changed files with 6 additions and 6 deletions
  1. +3
    -3
      src/usr.sbin/ntpd/client.c
  2. +3
    -3
      src/usr.sbin/ntpd/server.c

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

@ -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> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -133,8 +133,8 @@ client_query(struct ntp_peer *p)
} else } else
fatal("client_query connect"); 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"); log_warn("setsockopt IPTOS_LOWDELAY");
} }


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

@ -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> * 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) if ((la->fd = socket(la->sa.ss_family, SOCK_DGRAM, 0)) == -1)
fatal("socket"); 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"); log_warn("setsockopt IPTOS_LOWDELAY");
if (bind(la->fd, (struct sockaddr *)&la->sa, if (bind(la->fd, (struct sockaddr *)&la->sa,


Loading…
Cancel
Save