From owner-dev-commits-src-all@freebsd.org Sat Aug 21 17:59:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A5F467605E; Sat, 21 Aug 2021 17:59:11 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsR8b0w0Xz4Vk1; Sat, 21 Aug 2021 17:59:11 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 EF398114F3; Sat, 21 Aug 2021 17:59:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LHxArM008059; Sat, 21 Aug 2021 17:59:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LHxAmX008058; Sat, 21 Aug 2021 17:59:10 GMT (envelope-from git) Date: Sat, 21 Aug 2021 17:59:10 GMT Message-Id: <202108211759.17LHxAmX008058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 2544cb334d5f - stable/13 - rtsold: pass sending router address to other and managed script MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2544cb334d5f99c78b172d8eae65074eaaadef45 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 17:59:11 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2544cb334d5f99c78b172d8eae65074eaaadef45 commit 2544cb334d5f99c78b172d8eae65074eaaadef45 Author: Franco Fitchner AuthorDate: 2021-08-14 15:10:21 +0000 Commit: Mark Johnston CommitDate: 2021-08-21 16:10:22 +0000 rtsold: pass sending router address to other and managed script Reviewed by: markj (cherry picked from commit 02508a3d4e178b431fe5dda354a56d883f976c02) --- usr.sbin/rtsold/rtsol.c | 8 ++++++-- usr.sbin/rtsold/rtsold.8 | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index 76756bfd8393..646dd092cb0c 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -79,8 +79,8 @@ static int ra_opt_rdnss_dispatch(struct ifinfo *, struct rainfo *, struct script_msg_head_t *, struct script_msg_head_t *); static char *make_rsid(const char *, const char *, struct rainfo *); -#define _ARGS_MANAGED managedconf_script, ifi->ifname -#define _ARGS_OTHER otherconf_script, ifi->ifname +#define _ARGS_MANAGED managedconf_script, ifi->ifname, rasender +#define _ARGS_OTHER otherconf_script, ifi->ifname, rasender #define _ARGS_RESADD resolvconf_script, "-a", rsid #define _ARGS_RESDEL resolvconf_script, "-d", rsid @@ -301,6 +301,8 @@ rtsol_input(int sock) */ if (((nd_ra->nd_ra_flags_reserved) & ND_RA_FLAG_MANAGED) && !ifi->managedconfig) { + const char *rasender = inet_ntop(AF_INET6, &from.sin6_addr, + ntopbuf, sizeof(ntopbuf)); warnmsg(LOG_DEBUG, __func__, "ManagedConfigFlag on %s is turned on", ifi->ifname); ifi->managedconfig = 1; @@ -317,6 +319,8 @@ rtsol_input(int sock) */ if (((nd_ra->nd_ra_flags_reserved) & ND_RA_FLAG_OTHER) && !ifi->otherconfig) { + const char *rasender = inet_ntop(AF_INET6, &from.sin6_addr, + ntopbuf, sizeof(ntopbuf)); warnmsg(LOG_DEBUG, __func__, "OtherConfigFlag on %s is turned on", ifi->ifname); ifi->otherconfig = 1; diff --git a/usr.sbin/rtsold/rtsold.8 b/usr.sbin/rtsold/rtsold.8 index 273a2b4f0dd8..84e4d3013ef4 100644 --- a/usr.sbin/rtsold/rtsold.8 +++ b/usr.sbin/rtsold/rtsold.8 @@ -219,7 +219,8 @@ When the flag changes from FALSE to TRUE, .Nm will invoke .Ar script-name -with a single argument of the receiving interface name, +with a first argument of the receiving interface name +and a second argument of the sending router address, expecting the script will then start a protocol for the managed configuration. .Ar script-name @@ -233,7 +234,8 @@ When the flag changes from FALSE to TRUE, .Nm will invoke .Ar script-name -with a single argument of the receiving interface name, +with a first argument of the receiving interface name +and a second argument of the sending router address, expecting the script will then start a protocol for the other configuration. The script will not be run if the Managed Configuration flag in the