summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rarpd/rarpd.c
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1995-03-03 22:20:15 +0000
committerwpaul <wpaul@FreeBSD.org>1995-03-03 22:20:15 +0000
commitdfafbf1a3734fb3e3a05c637e7ba5f36ead8e7a3 (patch)
treee3abcb760538298e0e1d7dda785e649a8b9f0a91 /usr.sbin/rarpd/rarpd.c
parent060088a329bce8bf597266e445a5c106be00453d (diff)
downloadFreeBSD-src-dfafbf1a3734fb3e3a05c637e7ba5f36ead8e7a3.zip
FreeBSD-src-dfafbf1a3734fb3e3a05c637e7ba5f36ead8e7a3.tar.gz
Gave rarpd back the ability to poke temporary entries into the arp
table; arptab.c is really a hacked up version of arp.c that only supports adding temporary entries. (This stuff is nasty -- I wish I knew what was so wrong with SIOCSARP/SIOCGARP/etc... that made the BSD developers decide to take it out.) The idea here is that the client issuing the rarp is expected to be in the middle of booting and would therefore be unable to answer arp queries from other machines on the wire. Having rarpd stuff a temporary entry for the booting host into the local arp table helps keep arp requests from going unanswered. Also added ether_print() and ether_ntoa() to the ether_addr.c module. Eventually I'll get ether_aton() and ether_hostton() written and then this file can be dropped straight into libc. (Assuming no one objects, of course. :)
Diffstat (limited to 'usr.sbin/rarpd/rarpd.c')
-rw-r--r--usr.sbin/rarpd/rarpd.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index aa18dd8..0be3e6c 100644
--- a/usr.sbin/rarpd/rarpd.c
+++ b/usr.sbin/rarpd/rarpd.c
@@ -26,7 +26,7 @@ char copyright[] =
#ifndef lint
static char rcsid[] =
- "@(#) $Header: rarpd.c,v 1.6 91/01/09 14:47:00 mccanne Exp $ (LBL)";
+ "@(#) $Header: /a/ncvs/src/usr.sbin/rarpd/rarpd.c,v 1.1.1.1 1995/03/02 06:41:39 wpaul Exp $ (LBL)";
#endif
@@ -635,7 +635,7 @@ update_arptab(ep, ipaddr)
u_char *ep;
u_long ipaddr;
{
-#ifdef SIOCSARP_IS_DEPRECATED_IN_4_4BSD
+#ifdef SIOCSARP
int s;
struct arpreq request;
struct sockaddr_in *sin;
@@ -651,18 +651,21 @@ update_arptab(ep, ipaddr)
if (ioctl(s, SIOCSARP, (caddr_t)&request) < 0)
syslog(LOG_ERR, "SIOCSARP: %m");
(void)close(s);
+#else
+ if (arptab_set(ep, ipaddr) > 0)
+ syslog(LOG_ERR, "couldn't update arp table");
#endif
}
/*
* Build a reverse ARP packet and sent it out on the interface.
- * 'ep' points to a valid REVARP_REQUEST. The REVARP_REPLY is built
+ * 'ep' points to a valid ARPOP_REVREQUEST. The ARPOP_REVREPLY is built
* on top of the request, then written to the network.
*
* RFC 903 defines the ether_arp fields as follows. The following comments
* are taken (more or less) straight from this document.
*
- * REVARP_REQUEST
+ * ARPOP_REVREQUEST
*
* arp_sha is the hardware address of the sender of the packet.
* arp_spa is undefined.
@@ -672,7 +675,7 @@ update_arptab(ep, ipaddr)
* address of the sender.
* arp_tpa is undefined.
*
- * REVARP_REPLY
+ * ARPOP_REVREPLY
*
* arp_sha is the hardware address of the responder (the sender of the
* reply packet).
OpenPOWER on IntegriCloud