Currently rarpd can only listen on all or one interface, the
following lets multiple interfaces be specified like dhcpd.
Index: rarpd.8
===================================================================
RCS file: /cvs/src/usr.sbin/rarpd/rarpd.8,v
retrieving revision 1.17
diff -u -p -r1.17 rarpd.8
--- rarpd.8 23 May 2008 15:23:53 -0000 1.17
+++ rarpd.8 25 Aug 2010 14:25:06 -0000
@@ -30,11 +30,11 @@
.Sh SYNOPSIS
.Nm rarpd
.Op Fl adflt
-.Ar interface
+.Ar if0 Ar ... ifN
.Sh DESCRIPTION
.Nm
services Reverse ARP requests on the Ethernet connected to
-.Ar interface .
+the specified interfaces.
Upon receiving a request,
.Nm
maps the target hardware address to an IP address via its name, which
@@ -58,9 +58,7 @@ The options are as follows:
Listen on all the Ethernets attached to the system.
If
.Fl a
-is omitted, an
-.Ar interface
-must be specified.
+is omitted, a list of interfaces must be specified.
.It Fl d
Run in debug mode, with all the output to stderr.
This option implies the
Index: rarpd.c
===================================================================
RCS file: /cvs/src/usr.sbin/rarpd/rarpd.c,v
retrieving revision 1.49
diff -u -p -r1.49 rarpd.c
--- rarpd.c 27 Oct 2009 23:59:54 -0000 1.49
+++ rarpd.c 25 Aug 2010 14:25:06 -0000
@@ -134,14 +134,20 @@ main(int argc, char *argv[])
/* NOTREACHED */
}
}
- ifname = argv[optind++];
- if ((aflag && ifname) || (!aflag && ifname == 0))
+ argc -= optind;
+ argv += optind;
+
+ if ((aflag && argc > 0) || (!aflag && argc == 0))
usage();
if (aflag)
init_all();
else
- init_one(ifname);
+ while (argc > 0) {
+ init_one(argv[0]);
+ argc--;
+ argv++;
+ }
if ((!fflag) && (!dflag)) {
pid = fork();