Description: Conventions and portability.
 Alter the make file to reflect better the
 expected standards.
 .
 Minor improvments on the source code,
 including a logging message.
 .
 Select improvements to the manual page,
 mentioning capabilities in the existing
 source code, but which were not expressed
 in the existing manual page. Most importantly,
 mention the use of SIGHUP.
Author: Mats Erik Andersson <debian@gisladisker.se>
Forwarded: no
Last-Update: 2011-12-18

diff -Naurp rarpd-0.981107.debian/Makefile rarpd-0.981107/Makefile
--- rarpd-0.981107.debian/Makefile
+++ rarpd-0.981107/Makefile
@@ -1,11 +1,22 @@
-CC=gcc
-CFLAGS=-O2 -Wall -g $(DEFINES)
+CC ?= gcc
+CFLAGS ?= -O2 -Wall -g $(DEFINES)
 
 OBJ=rarpd.o #ethernet.o
 
+PREFIX ?= /usr/local
+MANPREFIX ?= $(PREFIX)/share/man
+
 all: rarpd
 
 rarpd: $(OBJ)
 
 clean:
 	rm -f $(OBJ) rarpd
+
+install:
+	install -d $(DESTDIR)$(PREFIX)/sbin
+	install -m 0755 rarpd $(DESTDIR)$(PREFIX)/sbin/
+	if [ -r rarpd.8 ]; then \
+		install -d $(DESTDIR)$(MANPREFIX)/man8; \
+		install -m 0644 rarpd.8 $(DESTDIR)$(MANPREFIX)/man8/; \
+	fi
diff -Naurp rarpd-0.981107.debian/rarpd.8 rarpd-0.981107/rarpd.8
--- rarpd-0.981107.debian/rarpd.8
+++ rarpd-0.981107/rarpd.8
@@ -2,7 +2,11 @@
 .SH NAME
 rarpd \- Reverse Address Resolution Protocol (RARP) daemon
 .SH SYNOPSIS
-.B "rarpd [-aAvde] [-b bootdir ] [ interface ]"
+.B rarpd
+.RB [\| \-aAvode \|]
+.RB [\| \-b
+.IR bootdir \|]
+.RI [\| interface \|]
 .SH DESCRIPTION
 .B Rarpd
 is a daemon which responds to RARP requests.
@@ -21,6 +25,10 @@ in hexadecimal uppercase letters is pres
 (usually
 .I /tftpboot
 ) before it decides to respond to the RARP request.
+.PP
+The optional argument \fIinterface\fR restricts the daemon instance
+to access only the indicated network interface. Only a single name
+is possible.
 .SH OPTIONS
 .TP
 .B \-a
@@ -42,19 +50,28 @@ the ethers database but the bootable ima
 .B rarpd
 will not respond to the request.
 .TP
-.B "\-b bootdir"
-Use
+.B \-o
+Accept offlink packages on the active interfaces.
+.TP
+.B \-b \fIbootdir\fR
+Access
 .I bootdir
 instead of the default
 .I /tftpboot
 as the TFTP boot directory for bootable image checks.
 .SH OBSOLETES
-This
+This daemon
 .B rarpd
 obsoletes kernel
 .B rarp
 daemon present in Linux kernels up to 2.2 which was controlled by the
 rarp(8) command.
+.SH SIGNALS
+.TP
+.B SIGHUP
+Renew the internal address list, which records IPv4 addresses available
+at each active network interface. The restriction set by the command
+line argument \fIinterface\fR is still in effect, if in use.
 .SH FILES
 .I /etc/ethers,
 .br
diff -Naurp rarpd-0.981107.debian/rarpd.c rarpd-0.981107/rarpd.c
--- rarpd-0.981107.debian/rarpd.c
+++ rarpd-0.981107/rarpd.c
@@ -33,6 +33,9 @@
 #include <linux/if_packet.h>
 #include <linux/filter.h>
 
+#ifndef ETH_ALEN
+# define ETH_ALEN 6	/* Ethernet address length. */
+#endif
 
 int do_reload = 1;
 
@@ -57,7 +60,7 @@ struct rarpiflink
 	int	       	index;
 	int		hatype;
 	u_int8_t	lladdr[ETH_ALEN];
-	unsigned char	name[IFNAMSIZ];
+	char		name[IFNAMSIZ];
 	struct rarpifaddr	*ifa_list;
 } *ifl_list;
 
@@ -82,7 +85,7 @@ struct rarp_map
 
 void usage()
 {
-	fprintf(stderr, "Usage: rarpd [ -dveaA ] [ -b tftpdir ] [ interface]\n");
+	fprintf(stderr, "Usage: rarpd [ -dveaAo ] [ -b tftpdir ] [ interface]\n");
 	exit(1);
 }
 
@@ -219,6 +222,7 @@ void load_if()
 
 void configure()
 {
+	syslog(LOG_INFO, "Building list of addresses per interface.");
 	load_if();
 	load_db();
 }
