Make the man page reflect reality. Add BUGS section about DNS.
Logging cleanups (including logging the requestor's MAC address instead of the server's).
This commit is contained in:
parent
d09481ba90
commit
bb50c4f8fb
@ -1,4 +1,4 @@
|
||||
.\" @(#) $Header: rarpd.8,v 1.3 93/07/19 19:34:24 leres Exp $ (LBL)
|
||||
.\" @(#) $Header: /home/ncvs/src/usr.sbin/rarpd/rarpd.8,v 1.4 1996/11/19 23:57:05 wpaul Exp $ (LBL)
|
||||
.\"
|
||||
.\" Copyright (c) 1990, 1991, 1993 The Regents of the University of
|
||||
.\" California. All rights reserved.
|
||||
@ -39,21 +39,24 @@ rarpd \- Reverse ARP Daemon
|
||||
services Reverse ARP requests on the Ethernet connected to
|
||||
.I interface.
|
||||
Upon receiving a request,
|
||||
.Irarpd
|
||||
.I rarpd
|
||||
maps the target hardware address to an IP address via its name, which
|
||||
must be present in both the
|
||||
.I ethers(5)
|
||||
and
|
||||
.I hosts(5)
|
||||
databases.
|
||||
If a host does not exist in both databses, the translation cannot
|
||||
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
|
||||
(i.e., the host that rarpd is running on)
|
||||
can "boot" the target; that is, if the directory
|
||||
/tftpboot/\fIipaddr\fP
|
||||
exists, where \fIipaddr\fP is the target IP address.
|
||||
can "boot" the target; that is, a file or directory matching the glob
|
||||
/tftpboot/\fIipaddr\fP*
|
||||
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.
|
||||
|
||||
In normal operation,
|
||||
.I rarpd
|
||||
@ -90,3 +93,8 @@ Craig Leres (leres@ee.lbl.gov) and
|
||||
Steven McCanne (mccanne@ee.lbl.gov).
|
||||
Lawrence Berkeley Laboratory, University of California, Berkeley, CA.
|
||||
.SH BUGS
|
||||
.I rarpd
|
||||
can depend on the DNS to resolve the name discovered from /etc/ethers.
|
||||
If this name is not in the DNS but is in /etc/hosts, the DNS lookup
|
||||
can cause a delayed RARP response, so in this situation it is reccommended to
|
||||
configure /etc/host.conf to read /etc/hosts first.
|
||||
|
@ -26,7 +26,7 @@ The Regents of the University of California. All rights reserved.\n";
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: rarpd.c,v 1.22 96/06/14 20:40:14 leres Exp $ (LBL)";
|
||||
"@(#) $Header: /home/ncvs/src/usr.sbin/rarpd/rarpd.c,v 1.10 1996/11/19 23:57:06 wpaul Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -406,7 +406,7 @@ init(target)
|
||||
void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr, "usage: rarpd [ -afv ] [ interface ]\n");
|
||||
(void)fprintf(stderr, "usage: rarpd [ -afnv ] [ interface ]\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -508,10 +508,8 @@ rarp_check(p, len)
|
||||
struct ether_arp *ap = (struct ether_arp *)(p + sizeof(*ep));
|
||||
|
||||
if (len < sizeof(*ep) + sizeof(*ap)) {
|
||||
syslog(LOG_ERR, "truncated request");
|
||||
#ifdef DEBUG
|
||||
printf ("len: %d expected: %d\n", len, sizeof(*ep) + sizeof(*ap));
|
||||
#endif
|
||||
syslog(LOG_ERR, "truncated request, got %d, expected %d",
|
||||
len, sizeof(*ep) + sizeof(*ap));
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
@ -624,7 +622,7 @@ rarp_loop()
|
||||
caplen = bhp->bh_caplen;
|
||||
hdrlen = bhp->bh_hdrlen;
|
||||
if (rarp_check(bp + hdrlen, caplen))
|
||||
rarp_process(ii, bp + hdrlen, cc);
|
||||
rarp_process(ii, bp + hdrlen, caplen);
|
||||
bp += BPF_WORDALIGN(hdrlen + caplen);
|
||||
}
|
||||
}
|
||||
@ -709,11 +707,17 @@ rarp_process(ii, pkt, len)
|
||||
|
||||
ep = (struct ether_header *)pkt;
|
||||
/* should this be arp_tha? */
|
||||
if (ether_ntohost(ename, &ep->ether_shost) != 0)
|
||||
if (ether_ntohost(ename, &ep->ether_shost) != 0) {
|
||||
syslog(LOG_ERR, "cannot map %s to name",
|
||||
eatoa(ep->ether_shost));
|
||||
return;
|
||||
}
|
||||
|
||||
if((hp = gethostbyname(ename)) == NULL)
|
||||
if ((hp = gethostbyname(ename)) == NULL) {
|
||||
syslog(LOG_ERR, "cannot map %s to IP address", ename);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Choose correct address from list.
|
||||
*/
|
||||
@ -943,7 +947,7 @@ rarp_reply(ii, ep, ipaddr, len)
|
||||
syslog(LOG_ERR, "write: only %d of %d bytes written", n, len);
|
||||
if (verbose)
|
||||
syslog(LOG_INFO, "%s %s at %s REPLIED", ii->ii_ifname,
|
||||
eatoa(ap->arp_sha),
|
||||
eatoa(ap->arp_tha),
|
||||
intoa(ntohl(ipaddr)));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user