summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rarpd
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>1996-11-27 20:42:09 +0000
committerfenner <fenner@FreeBSD.org>1996-11-27 20:42:09 +0000
commitc2f2394fba1c844b0d20931e00e4776fe91e6784 (patch)
tree157d985a81576b1212ac933e2025835bff0fd3aa /usr.sbin/rarpd
parent3d965dbf165ab109eefe933da40d347c032582a0 (diff)
downloadFreeBSD-src-c2f2394fba1c844b0d20931e00e4776fe91e6784.zip
FreeBSD-src-c2f2394fba1c844b0d20931e00e4776fe91e6784.tar.gz
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).
Diffstat (limited to 'usr.sbin/rarpd')
-rw-r--r--usr.sbin/rarpd/rarpd.820
-rw-r--r--usr.sbin/rarpd/rarpd.c24
2 files changed, 28 insertions, 16 deletions
diff --git a/usr.sbin/rarpd/rarpd.8 b/usr.sbin/rarpd/rarpd.8
index 1ad523b..459db1f 100644
--- a/usr.sbin/rarpd/rarpd.8
+++ b/usr.sbin/rarpd/rarpd.8
@@ -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.
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index adb7f59..10c2ec2 100644
--- a/usr.sbin/rarpd/rarpd.c
+++ b/usr.sbin/rarpd/rarpd.c
@@ -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)));
}
OpenPOWER on IntegriCloud