9front - general discussion about 9front
 help / color / mirror / Atom feed
From: covertusername967@gmail.com
To: 9front@9front.org
Subject: [9front] patch: add listenaddr plan9.ini variable
Date: Sun, 14 Mar 2021 19:58:36 -0500	[thread overview]
Message-ID: <2FBC435C73B76DF9CA33E979A5871720@gmail.com> (raw)

Hello,

This patch changes cpurc to check for a listenaddr= variable set from
plan9.ini.  If set, cpu servers will only listen on the specified
address.


diff -r cc26fdf57bb2 rc/bin/cpurc
--- a/rc/bin/cpurc	Sat Mar 13 14:57:53 2021 +0100
+++ b/rc/bin/cpurc	Sun Mar 14 19:57:16 2021 -0500
@@ -105,11 +105,17 @@
 }){
 	# cpu+auth server
 	auth/keyfs -wp -m /mnt/keys /adm/keys
-	aux/listen -q -t /rc/bin/service.auth -d $serviced tcp
+	if(test -e /env/listenaddr)
+		aux/listen -q -t /rc/bin/service.auth -d $serviced -a $listenaddr tcp
+	if not
+		aux/listen -q -t /rc/bin/service.auth -d $serviced tcp
 }
 if not {
 	# cpu server
-	aux/listen -q -d $serviced tcp
+	if(test -e /env/listenaddr)
+		aux/listen -q -d $serviced -a $listenaddr tcp
+	if not
+		aux/listen -q -d $serviced tcp
 }
 
 if(test -f /dev/apm)
diff -r cc26fdf57bb2 sys/man/8/plan9.ini
--- a/sys/man/8/plan9.ini	Sat Mar 13 14:57:53 2021 +0100
+++ b/sys/man/8/plan9.ini	Sun Mar 14 19:57:16 2021 -0500
@@ -450,6 +450,8 @@
 can be specified with the boot parameter above.
 .SS \fLnora6=
 Disable automatic IPv6 configuration from incoming router advertisements.
+.SS \fLlistenaddr\fI=ip\fP
+On cpu servers, restrict the IP address that listen(8) announces on to the specified address.
 .SS DISKS, TAPES
 (S)ATA controllers are autodetected.
 .SS \fL*nodma=\fP



                 reply	other threads:[~2021-03-15  1:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2FBC435C73B76DF9CA33E979A5871720@gmail.com \
    --to=covertusername967@gmail.com \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).