mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-28 08:02:54 +00:00
ndp: Move the global variable repeat into struct ndp_opts
An upcoming fix for the netlink based implementation requires this refactoring. No functional change intended. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47233
This commit is contained in:
parent
2dccd21949
commit
12c04071cf
@ -121,7 +121,6 @@
|
||||
static pid_t pid;
|
||||
static int32_t thiszone; /* time difference with gmt */
|
||||
static int s = -1;
|
||||
static int repeat = 0;
|
||||
|
||||
static char host_buf[NI_MAXHOST]; /* getnameinfo() */
|
||||
static char ifix_buf[IFNAMSIZ]; /* if_indextoname() */
|
||||
@ -249,8 +248,8 @@ main(int argc, char **argv)
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
mode = 'a';
|
||||
repeat = atoi(optarg);
|
||||
if (repeat < 0) {
|
||||
opts.repeat = atoi(optarg);
|
||||
if (opts.repeat < 0) {
|
||||
usage();
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
@ -828,10 +827,10 @@ dump_rtsock(struct sockaddr_in6 *addr, int cflag)
|
||||
if (buf != NULL)
|
||||
free(buf);
|
||||
|
||||
if (repeat) {
|
||||
if (opts.repeat) {
|
||||
xo_emit("\n");
|
||||
xo_flush();
|
||||
sleep(repeat);
|
||||
sleep(opts.repeat);
|
||||
goto again;
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ struct ndp_opts {
|
||||
bool tflag;
|
||||
int flags;
|
||||
time_t expire_time;
|
||||
int repeat;
|
||||
};
|
||||
|
||||
extern struct ndp_opts opts;
|
||||
|
Loading…
Reference in New Issue
Block a user