summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rarpd
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>1996-11-27 20:45:10 +0000
committerfenner <fenner@FreeBSD.org>1996-11-27 20:45:10 +0000
commitfa5c595ab72bc21d8a8875e4248cbcdffbd1b5cb (patch)
treefb9bfdb7089bae3b7c956a4ba92322933e975cf4 /usr.sbin/rarpd
parentc2f2394fba1c844b0d20931e00e4776fe91e6784 (diff)
downloadFreeBSD-src-fa5c595ab72bc21d8a8875e4248cbcdffbd1b5cb.zip
FreeBSD-src-fa5c595ab72bc21d8a8875e4248cbcdffbd1b5cb.tar.gz
Add -s flag to always supply mapping if known, ignoring the
presence or absence of files in /tftpboot.
Diffstat (limited to 'usr.sbin/rarpd')
-rw-r--r--usr.sbin/rarpd/rarpd.812
-rw-r--r--usr.sbin/rarpd/rarpd.c14
2 files changed, 20 insertions, 6 deletions
diff --git a/usr.sbin/rarpd/rarpd.8 b/usr.sbin/rarpd/rarpd.8
index 459db1f..5b83a85 100644
--- a/usr.sbin/rarpd/rarpd.8
+++ b/usr.sbin/rarpd/rarpd.8
@@ -26,7 +26,7 @@ rarpd \- Reverse ARP Daemon
.na
.B rarpd
[
-.B \-afv
+.B \-afsv
]
[
.I interface
@@ -49,7 +49,7 @@ databases.
If a host does not exist in both databases, the translation cannot
proceed and a reply will not be sent.
-Additionally, a request is honored only if the server
+By default, a request is honored only if the server
(i.e., the host that rarpd is running on)
can "boot" the target; that is, a file or directory matching the glob
/tftpboot/\fIipaddr\fP*
@@ -57,6 +57,9 @@ exists, where \fIipaddr\fP is the target IP address in hex.
For example, the IP address 204.216.27.18 will be replied to if any of
/tftpboot/CCD81B12, /tftpboot/CCD81B12.SUN3, or /tftpboot/CCD81B12-boot
exist.
+This requirement can be overridden with the
+.B \-s
+flag (see below).
In normal operation,
.I rarpd
@@ -74,6 +77,11 @@ If `-a' is omitted, an interface must be specified.
.B \-f
Run in the foreground.
.TP
+.B \-s
+Supply a response to any RARP request for which an ethernet to IP address
+mapping exists; do not depend on the existence of
+/tftpboot/\fIipaddr\fP*.
+.TP
.B \-v
Enable verbose sysloging.
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index 10c2ec2..0d9aa03 100644
--- a/usr.sbin/rarpd/rarpd.c
+++ b/usr.sbin/rarpd/rarpd.c
@@ -32,8 +32,8 @@ static const char rcsid[] =
/*
* rarpd - Reverse ARP Daemon
*
- * Usage: rarpd -a [ -fv ] [ hostname ]
- * rarpd [ -fv ] interface [ hostname ]
+ * Usage: rarpd -a [ -fsv ] [ hostname ]
+ * rarpd [ -fsv ] interface [ hostname ]
*
* 'hostname' is optional solely for backwards compatibility with Sun's rarpd.
* Currently, the argument is ignored.
@@ -170,6 +170,8 @@ void usage __P((void));
static u_char zero[6];
+int sflag = 0; /* ignore /tftpboot */
+
void
main(argc, argv)
int argc;
@@ -194,7 +196,7 @@ main(argc, argv)
openlog(name, LOG_PID | LOG_CONS, LOG_DAEMON);
opterr = 0;
- while ((op = getopt(argc, argv, "afv")) != EOF) {
+ while ((op = getopt(argc, argv, "afsv")) != EOF) {
switch (op) {
case 'a':
++aflag;
@@ -204,6 +206,10 @@ main(argc, argv)
++fflag;
break;
+ case 's':
+ ++sflag;
+ break;
+
case 'v':
++verbose;
break;
@@ -734,7 +740,7 @@ rarp_process(ii, pkt, len)
ename, intoa(ntohl(ii->ii_ipaddr & ii->ii_netmask)));
return;
}
- if (rarp_bootable(target_ipaddr))
+ if (sflag || rarp_bootable(target_ipaddr))
rarp_reply(ii, ep, target_ipaddr, len);
else if (verbose > 1)
syslog(LOG_INFO, "%s %s at %s DENIED (not bootable)",
OpenPOWER on IntegriCloud