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 .na
.B rarpd .B rarpd
[ [
.B \-afv .B \-afsv
] ]
[ [
.I interface .I interface
@ -49,7 +49,7 @@ databases.
If a host does not exist in both databases, the translation cannot If a host does not exist in both databases, the translation cannot
proceed and a reply will not be sent. 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) (i.e., the host that rarpd is running on)
can "boot" the target; that is, a file or directory matching the glob can "boot" the target; that is, a file or directory matching the glob
/tftpboot/\fIipaddr\fP* /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 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 /tftpboot/CCD81B12, /tftpboot/CCD81B12.SUN3, or /tftpboot/CCD81B12-boot
exist. exist.
This requirement can be overridden with the
.B \-s
flag (see below).
In normal operation, In normal operation,
.I rarpd .I rarpd
@ -74,6 +77,11 @@ If `-a' is omitted, an interface must be specified.
.B \-f .B \-f
Run in the foreground. Run in the foreground.
.TP .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 .B \-v
Enable verbose sysloging. Enable verbose sysloging.

View File

@ -32,8 +32,8 @@ static const char rcsid[] =
/* /*
* rarpd - Reverse ARP Daemon * rarpd - Reverse ARP Daemon
* *
* Usage: rarpd -a [ -fv ] [ hostname ] * Usage: rarpd -a [ -fsv ] [ hostname ]
* rarpd [ -fv ] interface [ hostname ] * rarpd [ -fsv ] interface [ hostname ]
* *
* 'hostname' is optional solely for backwards compatibility with Sun's rarpd. * 'hostname' is optional solely for backwards compatibility with Sun's rarpd.
* Currently, the argument is ignored. * Currently, the argument is ignored.
@ -170,6 +170,8 @@ void usage __P((void));
static u_char zero[6]; static u_char zero[6];
int sflag = 0; /* ignore /tftpboot */
void void
main(argc, argv) main(argc, argv)
int argc; int argc;
@ -194,7 +196,7 @@ main(argc, argv)
openlog(name, LOG_PID | LOG_CONS, LOG_DAEMON); openlog(name, LOG_PID | LOG_CONS, LOG_DAEMON);
opterr = 0; opterr = 0;
while ((op = getopt(argc, argv, "afv")) != EOF) { while ((op = getopt(argc, argv, "afsv")) != EOF) {
switch (op) { switch (op) {
case 'a': case 'a':
++aflag; ++aflag;
@ -204,6 +206,10 @@ main(argc, argv)
++fflag; ++fflag;
break; break;
case 's':
++sflag;
break;
case 'v': case 'v':
++verbose; ++verbose;
break; break;
@ -734,7 +740,7 @@ rarp_process(ii, pkt, len)
ename, intoa(ntohl(ii->ii_ipaddr & ii->ii_netmask))); ename, intoa(ntohl(ii->ii_ipaddr & ii->ii_netmask)));
return; return;
} }
if (rarp_bootable(target_ipaddr)) if (sflag || rarp_bootable(target_ipaddr))
rarp_reply(ii, ep, target_ipaddr, len); rarp_reply(ii, ep, target_ipaddr, len);
else if (verbose > 1) else if (verbose > 1)
syslog(LOG_INFO, "%s %s at %s DENIED (not bootable)", syslog(LOG_INFO, "%s %s at %s DENIED (not bootable)",