Skip to content

Commit 02508a3

Browse files
fichtnermarkjdb
authored andcommitted
rtsold: pass sending router address to other and managed script
Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31518
1 parent bfa812f commit 02508a3

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

usr.sbin/rtsold/rtsol.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ static int ra_opt_rdnss_dispatch(struct ifinfo *, struct rainfo *,
7979
struct script_msg_head_t *, struct script_msg_head_t *);
8080
static char *make_rsid(const char *, const char *, struct rainfo *);
8181

82-
#define _ARGS_MANAGED managedconf_script, ifi->ifname
83-
#define _ARGS_OTHER otherconf_script, ifi->ifname
82+
#define _ARGS_MANAGED managedconf_script, ifi->ifname, rasender
83+
#define _ARGS_OTHER otherconf_script, ifi->ifname, rasender
8484
#define _ARGS_RESADD resolvconf_script, "-a", rsid
8585
#define _ARGS_RESDEL resolvconf_script, "-d", rsid
8686

@@ -301,6 +301,8 @@ rtsol_input(int sock)
301301
*/
302302
if (((nd_ra->nd_ra_flags_reserved) & ND_RA_FLAG_MANAGED) &&
303303
!ifi->managedconfig) {
304+
const char *rasender = inet_ntop(AF_INET6, &from.sin6_addr,
305+
ntopbuf, sizeof(ntopbuf));
304306
warnmsg(LOG_DEBUG, __func__,
305307
"ManagedConfigFlag on %s is turned on", ifi->ifname);
306308
ifi->managedconfig = 1;
@@ -317,6 +319,8 @@ rtsol_input(int sock)
317319
*/
318320
if (((nd_ra->nd_ra_flags_reserved) & ND_RA_FLAG_OTHER) &&
319321
!ifi->otherconfig) {
322+
const char *rasender = inet_ntop(AF_INET6, &from.sin6_addr,
323+
ntopbuf, sizeof(ntopbuf));
320324
warnmsg(LOG_DEBUG, __func__,
321325
"OtherConfigFlag on %s is turned on", ifi->ifname);
322326
ifi->otherconfig = 1;

usr.sbin/rtsold/rtsold.8

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ When the flag changes from FALSE to TRUE,
219219
.Nm
220220
will invoke
221221
.Ar script-name
222-
with a single argument of the receiving interface name,
222+
with a first argument of the receiving interface name
223+
and a second argument of the sending router address,
223224
expecting the script will then start a protocol for the managed
224225
configuration.
225226
.Ar script-name
@@ -233,7 +234,8 @@ When the flag changes from FALSE to TRUE,
233234
.Nm
234235
will invoke
235236
.Ar script-name
236-
with a single argument of the receiving interface name,
237+
with a first argument of the receiving interface name
238+
and a second argument of the sending router address,
237239
expecting the script will then start a protocol for the other
238240
configuration.
239241
The script will not be run if the Managed Configuration flag in the

0 commit comments

Comments
 (0)