History log of /freebsd-10.1-release/usr.sbin/rarpd/
Revision Date Author Comments
272461 03-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


249234 07-Apr-2013 marius

Add some missing newlines and static declarations.

MFC after: 3 days


246143 31-Jan-2013 glebius

Retire struct sockaddr_inarp.

Since ARP and routing are separated, "proxy only" entries
don't have any meaning, thus we don't need additional field
in sockaddr to pass SIN_PROXY flag.

New kernel is binary compatible with old tools, since sizes
of sockaddr_inarp and sockaddr_in match, and sa_family are
filled with same value.

The structure declaration is left for compatibility with
third party software, but in tree code no longer use it.

Reviewed by: ru, andre, net@


238300 09-Jul-2012 joel

Remove end of line whitespace.


238282 09-Jul-2012 hrs

- Add IFT_L2VLAN (vlan(4)) support.
- Add -P option to support PID file. When -a is specified /var/run/rarpd.pid
is used, and when an interface is specified /var/run/rarpd.<ifname>.pid is
used by default.


230346 20-Jan-2012 eadler

Fix warning when compiling with gcc46:
error: variable 'hostname' set but not used

Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after: 3 days


216225 06-Dec-2010 glebius

Catch up with kernel using time_uptime to drive ARP timeouts.

Noticed by: jilles


141580 09-Feb-2005 ru

Fixed the misplaced $FreeBSD$.


133249 07-Aug-2004 imp

Per letter dated July 22, 1999 remove 3rd clause of Berkeley derived software
(with permission of addtional copyright holders where appropriate)


128474 20-Apr-2004 joerg

While walking over the list of interfaces obtained from getifaddrs(3),
rarpd clobbered any AF_INET information already configured for a given
interface name, so interfaces with more than one IP address made rarpd
listen only for the last address out of all IP aliases.

I changed this, so that AF_LINK information is always collected first
(to ensure the interface name gets its link-layer address associated),
but while looking for AF_INET addresses, the configuration is cloned
if there has already been one IP address seen for that interface name.

Thus, rarpd now effectively listens on all subnets.

MFC after: 1 week


128469 20-Apr-2004 joerg

Fix a typo.


119003 16-Aug-2003 charnier

Make it clear that -a flag and interface parameter are mutually exclusive


117452 11-Jul-2003 mux

Lower WARNS to 3 so that this still compiles on non x86 architectures.


117446 11-Jul-2003 mux

Huge cleanup of the rarpd(8) code :
- Use getifaddrs() instead of rolling our own buggy one. Previously,
rarpd(8) would fail to see some interfaces because of a hardcoded limit.
It now successfully sees any interface in the system, and this also makes
the code _much_ simpler.
- Replace strncpy() calls with strlcpy() calls. Some uses of strncpy()
were bogus ; the code wasn't ensuring that the string was NUL terminated.
- Don't try to guard about select() FD_* macros being undefined.
- Use IF_NAMESIZE and ETHER_ADDR_LEN macros where appropriate.
- Add static keywords to function definitions for consistency, since
the prototypes have it (I wonder why GCC didn't complain about this).
- Remove compat code for very old BSD versions and SunOS.
- Remove code for systems not having the dirent.h header.
- The code is now WARNS=5 clean so mark it as such.
- Don't add -DTFTP_DIR="/tftpboot" to the build command line since it's
the default.

MFC after: 2 weeks


116369 15-Jun-2003 jmg

make rarpd use in_addr_t instead of u_long since this is neccessary
on 64bit platforms

ok'd by: silence


114601 03-May-2003 obrien

Use __FBSDID over rcsid[]. Protect copyright[] where needed.


103347 15-Sep-2002 dwmalone

Add "-t" to useage message and comment. (The -t option was added
independently by Robert, but also proposed in the PR below).

PR: 38126
Submitted by: Josh Elsasser <jre@vineyard.net>
MFC after: 1 month


99968 14-Jul-2002 charnier

The .Nm utility


96254 09-May-2002 roberto

Fix buildworld breakage.

Submitted by: Maxim Konovalov <maxim@macomnet.ru>


86679 20-Nov-2001 rwatson

Grammatical fixes over previous commit.

Submitted by: ru


86460 16-Nov-2001 rwatson

o Allow rarpd to accept an additional '-t directory' argument, specifying
an alternative to /tftpboot. This is useful it you're using tftpd
with an alternative root (using -s), and would like rarpd to respond
selectively to RARP requests using the same criteria as tftp.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs


80029 20-Jul-2001 obrien

Perform a major cleanup of the usr.sbin Makefiles.
These are not perfectly in agreement with each other style-wise, but they
are orders of orders of magnitude more consistent style-wise than before.


79333 05-Jul-2001 mjacob

make it compile on alpha again


78402 18-Jun-2001 roam

Add a -d command-line option; when used in conjunction with -f, rarpd
sends error messages to stderr, normal output to stdout, instead of
logging everything via syslog.

Turn off the FORMAT_AUDIT in the Makefile, until I can figure out how
to disable the check for one single line in the source :(

Reviewed by: dd, silence on -audit
MFC after: 1 month


78357 16-Jun-2001 jlemon

Comply with POSIX rules:
o Use %u for printing u_int.
o Cast sizeof() to u_long, and print with %lu

Reviewed by: wollman


78338 16-Jun-2001 jlemon

Undo last braino and fix properly.


78337 16-Jun-2001 jlemon

Fix warning:
489: warning: int format, different type arg (arg 4)


78163 13-Jun-2001 bde

Fixed world breakage on systems where ntohl() doesn't return u_long
(e.g., on alphas, or even on i386's with a POSIX-200x-conformant
ntohl() (ntohl() returns uint32_t which is u_int on i386's)).

Fixed related bugs and bogons while I'm here:
- ntohl() was "fixed" for printing in 1 place by casting to
"(unsigned int )". This breaks the value on systems where u_int
is smaller than uint32_t, and has 2 style bugs.
- spell u_int consistently (never use "unsigned").
- break K&R support some more (don't cast malloc()'s arg to a wrong
type...).


78057 11-Jun-2001 roam

WARNS=2 cleanup, ANSIfication, manpage mdoc(7) cleanup.

Once again, as explained in my messages to -audit, the ANSIfication comes
as part of the preparation to add a new -d command-line flag to send
output to stdout/stderr. That commit will come in a week, pending any
further comments/objections. For those who have missed the -audit mails,
it's at http://people.FreeBSD.org/~roam/bsd/rarpd/usr.sbin-rarpd-d.patch

Asbestos suit: on ;)
Reviewed by: dd, silence on -audit
MFC after: 1 month


74816 26-Mar-2001 ru

- Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.


74532 20-Mar-2001 ru

Set the default manual section for usr.sbin/ to 8.


70403 27-Dec-2000 ru

Prepare for mdoc(7)NG.


69027 22-Nov-2000 ru

mdoc(7) police: do not split author names in the AUTHORS section.


68965 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


68955 20-Nov-2000 sheldonh

Fix broken (sectionless) cross-reference in ref 1.10.


65532 06-Sep-2000 nectar

Add nsswitch support. By creating an /etc/nsswitch.conf file, you can
configure FreeBSD so that various databases such as passwd and group can be
looked up using flat files, NIS, or Hesiod.

= Hesiod has been added to libc (see hesiod(3)).

= A library routine for parsing nsswitch.conf and invoking callback
functions as specified has been added to libc (see nsdispatch(3)).

= The following C library functions have been modified to use nsdispatch:
. getgrent, getgrnam, getgrgid
. getpwent, getpwnam, getpwuid
. getusershell
. getaddrinfo
. gethostbyname, gethostbyname2, gethostbyaddr
. getnetbyname, getnetbyaddr
. getipnodebyname, getipnodebyaddr, getnodebyname, getnodebyaddr

= host.conf has been removed from src/etc. rc.network has been modified
to warn that host.conf is no longer used at boot time. In addition, if
there is a host.conf but no nsswitch.conf, the latter is created at boot
time from the former.

Obtained from: NetBSD


53766 27-Nov-1999 charnier

Remove incorrect section name. Incomplete -Wall cleaning.


51287 15-Sep-1999 peter

Fix warning: return type of `main' is not `int'


50479 28-Aug-1999 peter

$Id$ -> $FreeBSD$


41561 06-Dec-1998 alex

Sync usage string with reality: removed -n, added -s.


35003 02-Apr-1998 roberto

Fix bug in rarpd:

Explanation of the bug: when processing its first request, rarpd
opens a routing socket to send requests to the arp table. It keeps
that socket open afterwards, while waiting for new RARP requests.

Meanwhile, the data received on the routing socket fill up until
they are about 8Kbytes in size. Any additional data is lost.

When rarpd receives its next RARP request, it tries to access the
ARP table via a routing socket call, then waits for the answer to
its own request. This answer is lost because the received data is
already filled: when looking for the reply, rarpd receives only
8kbytes worth of data, then loops waiting forever.

Someone please test it on -STABLE and commit it. We can close the PR
when testing on STABLE is done.

PR: bin/5669
Submitted by: Pierre Beyssac <pb@fasterix.freenix.org>


32570 16-Jan-1998 bde

Removed most unused includes of <net/if_var.h> outside the kernel.


30372 13-Oct-1997 charnier

Mdoc'ify man page.


24428 31-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


22997 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


21264 03-Jan-1997 wollman

Update to match changes in <net/if.h>.


19986 27-Nov-1996 fenner

Add -s flag to always supply mapping if known, ignoring the
presence or absence of files in /tftpboot.


19985 27-Nov-1996 fenner

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


19889 19-Nov-1996 wpaul

Although I got rarpd to work, it was largely through kludgery. Bill
Fenner was kind enough to point out the error of my ways. This incorporates
diffs from him which:

- Keep everything in network order.
- Log the booted ether & ip address, instead of my address on that net
- change several exit()'s to return()'s, so that rarpd continues running
even if it thinks it's in a weird state.

One small tweak by me: in rarp_bootable(), we have to make sure to
construct 'ipname' in host byte order (if we don't, we have to
specify /tftpboot/<remote IP in hex> with <remote IP in hex> in
network byte order, which is confusing).

Also restored use of <dirent.h> rather than <sys/dir.h> as pointed
out by bde.

Also updated the man page so that the -v flag is documented.

With any luck, I won't have to touch this thing again.


19863 18-Nov-1996 wpaul

Dohw! Left out one important htonl() in update_arptab().

Pointed out by: Bill Fenner


19859 18-Nov-1996 wpaul

Fix up new rarpd.

This includes the following changes:

- Support for poking ARP entries into the local table is now built
in, so the arptab.c module I hacked together is no longer needed.

- rarp_process() and rarp_reply() now accept a len argument which is
passed down from rarp_loop() which tells rarp_reply() exactly how
long the original RARP frame was. (Usually, it's 60 bytes, which is
the minimum.) Previously, the length was calculated using the sum
of sizeof(struct ether_header) + sizeof(struct ether_arp) (plus the
ethernet frame header, I think). The result was a total packet
length of 42 bytes. Now, rarp_reply() sends out packets that are
the same size as those it recieves (60 bytes). This agrees with the
behavior of rarpd on SunOS (as observed with tcpdump). The unused
extra bytes are zeroed.


19856 18-Nov-1996 wpaul

This commit was generated by cvs2svn to compensate for changes in r19855,
which included commits to RCS files with non-trunk default branches.


18485 24-Sep-1996 bde

Eliminated includes of the "temporary" backwards compatibility header
<sys/dir.h> in applications. Maintained existing (inadequate) ifdefs
for dir.h vs dirent.h in libdialog, amd and rarpd, but didn't add any
new ones.


17817 24-Aug-1996 wpaul

It appears that with FreeBSD-current, we need to set the ethernet
frame type in network byte order. The htons() that wasn't needed in
2.1 is now required in 2.2.

Ultimately, this rarpd should be replaced with the more recent one
supplied with the new BPF distribution.


13744 30-Jan-1996 mpp

Fix a bunch of spelling errors in a bunch of man pages.


13122 30-Dec-1995 peter

recording cvs-1.6 file death


9577 18-Jul-1995 wpaul

Use daemon() to deamonify ourselves.


8857 30-May-1995 rgrimes

Remove trailing whitespace.


7577 02-Apr-1995 wpaul

Get rid of ether_addr.c: it's been moved to libc. Also add proper
declaration for ether_ntohost(). (Does anyone know what header file
is supposed to contain the declarations for the ether_addr functions?
I can't them in the SunOS includes anywhere.)


7382 26-Mar-1995 wpaul

Make sure we free() the result returned to us by yp_match().


6910 05-Mar-1995 wpaul

ether_addr.c:

- Implement ether_hostton()
- Implement ether_aton()
- Modify ether_aton() and ether_ntoa() to match the semantics of the
SunOS versions of these functions.
- Neaten up ether_hostton() and ether_ntohost() a little.
- Get rid of ether_print() since it isn't needed for rarpd and it isn't
documented as a standard ethers(5) function.

rarpd.8:

- Make it clear that the 'ipaddr' that rarpd looks for in /tftpboot
is actually in hexadecimal (as in /tftpboot/803B4032) since those who
are not versed in the black art of system administration are not likely
to know this.


6898 05-Mar-1995 bde

Don't depend on <stdio.h> bogusly including <sys/types.h>.


6866 03-Mar-1995 wpaul

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. :)


6824 02-Mar-1995 wpaul

This commit was generated by cvs2svn to compensate for changes in r6823,
which included commits to RCS files with non-trunk default branches.