From nobody Thu Nov 11 10:04:39 2021 X-Original-To: freebsd-net@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 4C7CC18583D1 for ; Thu, 11 Nov 2021 10:04:42 +0000 (UTC) (envelope-from misho@elwix.org) Received: from mail.elwix.net (ns.aitbg.com [95.87.254.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4HqclF1vF2z4Wmn; Thu, 11 Nov 2021 10:04:41 +0000 (UTC) (envelope-from misho@elwix.org) Received: from terran.aitnet.org (unknown [87.246.28.119]) by mail.elwix.net (Postfix) with ESMTPSA id ED404910A; Thu, 11 Nov 2021 12:04:28 +0200 (EET) Date: Thu, 11 Nov 2021 12:04:39 +0200 From: Michael Pounov To: freebsd-net@freebsd.org Cc: hrs@FreeBSD.org Subject: rtadvctl unable to connect to different control socket of radvd Message-Id: <20211111120439.88ca9557ed37d10947d165fd@elwix.org> Organization: ELWIX X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.0) List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Thu__11_Nov_2021_12_04_39_+0200_XBoVkQsM/qOw3LaX" X-Rspamd-Queue-Id: 4HqclF1vF2z4Wmn X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of misho@elwix.org has no SPF policy when checking 95.87.254.42) smtp.mailfrom=misho@elwix.org X-Spamd-Result: default: False [2.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-diff]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[elwix.org]; HAS_ATTACHMENT(0.00)[]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; HAS_ORG_HEADER(0.00)[]; AUTH_NA(1.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_SPAM_LONG(1.00)[1.000]; R_SPF_NA(0.00)[no SPF record]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; ASN(0.00)[asn:43561, ipnet:95.87.192.0/18, country:BG]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[87.246.28.119:received] X-ThisMailContainsUnwantedMimeParts: N This is a multi-part message in MIME format. --Multipart=_Thu__11_Nov_2021_12_04_39_+0200_XBoVkQsM/qOw3LaX Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi Hiroki Sato I mention you because I believe that you are right person like author of rtadvctl tool. I found issue with management of running rtadvd service instance. When we choose to working with different control socket path instead default one. rtadvctl lose any capability to operate with existing rtadvd instance, because it have no any kind of option to change connection path of control socket I made one patch to solve this problem with minimal disturbing of whole code. If you thinking that is ok. You are feel free to take it I am using same option -C in rtadvctl as like in rtadvd Br -- Michael Pounov ELWIX.ORG CloudSigma AG --Multipart=_Thu__11_Nov_2021_12_04_39_+0200_XBoVkQsM/qOw3LaX Content-Type: text/x-diff; name="rtadvctl_ctrlsock.patch" Content-Disposition: attachment; filename="rtadvctl_ctrlsock.patch" Content-Transfer-Encoding: 7bit diff --git a/usr.sbin/rtadvctl/rtadvctl.c b/usr.sbin/rtadvctl/rtadvctl.c index 8bbd7afb6dd..f191b25c174 100644 --- a/usr.sbin/rtadvctl/rtadvctl.c +++ b/usr.sbin/rtadvctl/rtadvctl.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -155,9 +156,13 @@ main(int argc, char *argv[]) int ch; int (*action)(int, char **) = NULL; int error; + char ctrlsock_name[MAXPATHLEN] = _PATH_CTRL_SOCK; - while ((ch = getopt(argc, argv, "Dv")) != -1) { + while ((ch = getopt(argc, argv, "DvC:")) != -1) { switch (ch) { + case 'C': + strlcpy(ctrlsock_name, optarg, sizeof ctrlsock_name); + break; case 'D': vflag = LOG_DEBUG; break; @@ -174,6 +179,8 @@ main(int argc, char *argv[]) if (argc == 0) usage(); + ctrlsock.si_name = ctrlsock_name; + for (i = 0; (size_t)i < sizeof(dtable)/sizeof(dtable[0]); i++) { if (dtable[i].dt_comm == NULL || strcmp(dtable[i].dt_comm, argv[0]) == 0) { --Multipart=_Thu__11_Nov_2021_12_04_39_+0200_XBoVkQsM/qOw3LaX--