Browse Source

keep an ID per server we talk to

OPENBSD_3_6
henning 20 years ago
parent
commit
285ef64de8
2 changed files with 7 additions and 2 deletions
  1. +2
    -1
      src/usr.sbin/ntpd/ntpd.h
  2. +5
    -1
      src/usr.sbin/ntpd/parse.y

+ 2
- 1
src/usr.sbin/ntpd/ntpd.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: ntpd.h,v 1.30 2004/07/28 16:38:43 henning Exp $ */
/* $OpenBSD: ntpd.h,v 1.31 2004/07/29 11:01:48 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -95,6 +95,7 @@ struct ntp_offset {
struct ntp_peer {
TAILQ_ENTRY(ntp_peer) entry;
u_int32_t id;
struct ntp_addr_wrap addr_head;
struct ntp_addr *addr;
struct ntp_query *query;


+ 5
- 1
src/usr.sbin/ntpd/parse.y View File

@ -1,4 +1,4 @@
/* $OpenBSD: parse.y,v 1.16 2004/07/28 16:56:21 henning Exp $ */
/* $OpenBSD: parse.y,v 1.17 2004/07/29 11:01:48 henning Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -41,6 +41,7 @@ static int lineno = 1;
static int errors = 0;
static int pdebug = 1;
char *infile;
static u_int32_t maxid;
int yyerror(const char *, ...);
int yyparse(void);
@ -171,6 +172,7 @@ conf_main : LISTEN ON address {
p = calloc(1, sizeof(struct ntp_peer));
if (p == NULL)
fatal("conf_main server calloc");
p->id = ++maxid;
h->next = NULL;
p->addr = h;
p->addr_head.a = h;
@ -189,6 +191,7 @@ conf_main : LISTEN ON address {
if ((p = calloc(1, sizeof(struct ntp_peer))) == NULL)
fatal("conf_main server calloc");
p->id = ++maxid;
for (h = $2->a; h != NULL; h = next) {
next = h->next;
if (h->ss.ss_family != AF_INET &&
@ -478,6 +481,7 @@ parse_config(char *filename, struct ntpd_conf *xconf)
conf = xconf;
lineno = 1;
errors = 0;
maxid = 0;
TAILQ_INIT(&conf->listen_addrs);
TAILQ_INIT(&conf->ntp_peers);


Loading…
Cancel
Save