Browse Source

fix looking at the mode bits so that we do not reply to broadcast and other

junk. from thorsten glaser.
OPENBSD_4_6
henning 15 years ago
parent
commit
e519398421
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      src/usr.sbin/ntpd/server.c

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

@ -1,4 +1,4 @@
/* $OpenBSD: server.c,v 1.34 2008/11/10 17:55:36 deraadt Exp $ */
/* $OpenBSD: server.c,v 1.35 2009/05/20 14:55:59 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -161,8 +161,10 @@ server_dispatch(int fd, struct ntpd_conf *lconf)
reply.status |= (query.status & VERSIONMASK);
if ((query.status & MODEMASK) == MODE_CLIENT)
reply.status |= MODE_SERVER;
else
else if ((query.status & MODEMASK) == MODE_SYM_ACT)
reply.status |= MODE_SYM_PAS;
else /* ignore packets of different type (e.g. bcast) */
return (0);
reply.stratum = lconf->status.stratum;
reply.ppoll = query.ppoll;


Loading…
Cancel
Save