1
0
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:
Zhenlei Huang 2024-11-01 00:32:13 +08:00
parent 2dccd21949
commit 12c04071cf
2 changed files with 5 additions and 5 deletions

View File

@ -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;
}

View File

@ -10,6 +10,7 @@ struct ndp_opts {
bool tflag;
int flags;
time_t expire_time;
int repeat;
};
extern struct ndp_opts opts;