From nobody Thu Nov 07 23:26:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xkyrc3qTfz5cqbG; Thu, 07 Nov 2024 23:26:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xkyrc3Dmpz4Mq5; Thu, 7 Nov 2024 23:26:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731022000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DCGhsBnfSr0PE/R9eTpFQQ5bL10mDxIRUBKFhP5mIrM=; b=Pgj2KCCpVPyUPk0UX3X6+LGwYpt5mEW6GkAfepz8ZgY8ySNiPkZmxhvNfW5kjj9lgvhsWB DT0T28TlpxJG81KC3bn2zCl/AOmvi+E+LC4tOZWkiqiHNUsiOPhb2+81mVgitjsTKoM4N8 CCa4uVoQZ/oCa9MQqdHuaZB5bxBUMjMSJ6Mq/c3ZBGmOZ+UVTVqvmsXFIkrJTwW5/Pm3lK HCQSxH3XGr7SrlNDyBLqAHWHJdxKGLHsVrDflBt9sgdijQZtAG1LImmnRCBZrgSSWW+0MW eeUJoocyJyggy2VPBHMKNQRlR+AGDYjSsEWVtjMArMuuyOewH3LVSFvzwktmfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731022000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DCGhsBnfSr0PE/R9eTpFQQ5bL10mDxIRUBKFhP5mIrM=; b=cr4BOnlGyBOo86Sf++fNz//rlfH+ZULYDlHlsyB/cCn5IworS5nYzIfh1Rat5jn7A5dYme yY2OXlKHF211JMmU7ymY9+KQq7QJUgCXXkRmrGilG4F4jld6vDnuE5ZVjmjzhHKThnvYOR l2qvZBgAROo5UwtO5xUlJv1QYDRaQCZYzZjq1qMHYLA4T8hoc9Ms0YHoDIVRuz5WF3snsh oozsoo7CnND4OvvzDQUiiZJqec+e87JQ6SYPx+fQrQSQO860XXS6wsO2ybRBwFeouZXCMM VhZMljFHj7JqA22Lq1EAzMZihaI3i2SkX3gTMfZVpL13vOMkiBf5t+qS0eNvWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731022000; a=rsa-sha256; cv=none; b=NN+Bs6b2icLW1vQLudJG7Q+i1Pe+1n63uKA2mldq95ydIfxpHiUcUy8evp0sWeTttDZXn7 xKuNb6ZEA8wQGyoMfoHHIPQ3uPH8WtezwfQ8Dz1DJ5DrlgZK2I7fAqod2eyQD7i4GcxFuq gPED606a5CQB3/RaXkyDYi/+EljGhCoDAhjFMIYUpLN0Po94RTeXvX3z9hJdhyRXXe1+3r SZUKMc22NSzVv5O255TkMwvb4VOiHC89TriqSvNlxQq8c/xPVvH1A3uBtcL0SSJ7Cn/OcA 5ZXsRKlMq+LW8WNBuTmqFH2KO5TS24QHCdIzf94ZvjGTCmBryr+ZAFr2mwts2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xkyrc2jrcz14pp; Thu, 7 Nov 2024 23:26:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A7NQeWE033676; Thu, 7 Nov 2024 23:26:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A7NQefe033673; Thu, 7 Nov 2024 23:26:40 GMT (envelope-from git) Date: Thu, 7 Nov 2024 23:26:40 GMT Message-Id: <202411072326.4A7NQefe033673@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 0be04cb5cb98 - releng/14.2 - ndp: Move the global variable repeat into struct ndp_opts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 0be04cb5cb9854d71cd98b10a35111b289cd21a5 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0be04cb5cb9854d71cd98b10a35111b289cd21a5 commit 0be04cb5cb9854d71cd98b10a35111b289cd21a5 Author: Zhenlei Huang AuthorDate: 2024-10-31 16:32:13 +0000 Commit: Zhenlei Huang CommitDate: 2024-11-07 23:26:09 +0000 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 Approved by: re (cperciva) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47233 (cherry picked from commit 12c04071cf18d1b00ffcc7058fb01f4393163ede) (cherry picked from commit 54514cfa5a84a5d4406bbd5ba34f8950cf1a2b89) --- usr.sbin/ndp/ndp.c | 9 ++++----- usr.sbin/ndp/ndp.h | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index e98e506ee482..89666f7eb633 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -125,7 +125,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() */ @@ -252,8 +251,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*/ } @@ -823,10 +822,10 @@ again: if (buf != NULL) free(buf); - if (repeat) { + if (opts.repeat) { xo_emit("\n"); xo_flush(); - sleep(repeat); + sleep(opts.repeat); goto again; } diff --git a/usr.sbin/ndp/ndp.h b/usr.sbin/ndp/ndp.h index 5b2558982e86..6e7aef2e416e 100644 --- a/usr.sbin/ndp/ndp.h +++ b/usr.sbin/ndp/ndp.h @@ -10,6 +10,7 @@ struct ndp_opts { bool tflag; int flags; time_t expire_time; + int repeat; }; extern struct ndp_opts opts;