Add -s flag to always supply mapping if known, ignoring the

presence or absence of files in /tftpboot.
This commit is contained in:
Bill Fenner 1996-11-27 20:45:10 +00:00
parent b60287db00
commit a9695b96ac
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19986
2 changed files with 20 additions and 6 deletions

View File

@ -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.

View File

@ -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)",