summaryrefslogtreecommitdiff
path: root/usr.sbin/rarpd
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2010-08-26 17:07:47 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2010-08-26 17:07:47 +0000
commitb9d754002fdd08e94665c432f636f4bdb79f70ac (patch)
tree94bbff0f4cabc02a0a2af1f32e6e3f964671b06b /usr.sbin/rarpd
parent68379a6601331ff785d0be4f9c2b6d3114eed3de (diff)
Allow multiple interfaces to be specified instead of all or one.
ok krw@ claudio@
Diffstat (limited to 'usr.sbin/rarpd')
-rw-r--r--usr.sbin/rarpd/rarpd.814
-rw-r--r--usr.sbin/rarpd/rarpd.c16
2 files changed, 17 insertions, 13 deletions
diff --git a/usr.sbin/rarpd/rarpd.8 b/usr.sbin/rarpd/rarpd.8
index f159c96fd2a..a7ec630bb68 100644
--- a/usr.sbin/rarpd/rarpd.8
+++ b/usr.sbin/rarpd/rarpd.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rarpd.8,v 1.17 2008/05/23 15:23:53 sobrado Exp $
+.\" $OpenBSD: rarpd.8,v 1.18 2010/08/26 17:07:46 jsg Exp $
.\" $NetBSD: rarpd.8,v 1.7 1998/04/15 15:06:06 mrg Exp $
.\"
.\" Copyright (c) 1988-1990 The Regents of the University of California.
@@ -19,9 +19,9 @@
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-.\" @(#) $Id: rarpd.8,v 1.17 2008/05/23 15:23:53 sobrado Exp $
+.\" @(#) $Id: rarpd.8,v 1.18 2010/08/26 17:07:46 jsg Exp $
.\"
-.Dd $Mdocdate: May 23 2008 $
+.Dd $Mdocdate: August 26 2010 $
.Dt RARPD 8
.Os
.Sh NAME
@@ -30,11 +30,11 @@
.Sh SYNOPSIS
.Nm rarpd
.Op Fl adflt
-.Ar interface
+.Ar if0 Op 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
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index bdfadfb5bde..a17455d9040 100644
--- a/usr.sbin/rarpd/rarpd.c
+++ b/usr.sbin/rarpd/rarpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rarpd.c,v 1.49 2009/10/27 23:59:54 deraadt Exp $ */
+/* $OpenBSD: rarpd.c,v 1.50 2010/08/26 17:07:46 jsg Exp $ */
/* $NetBSD: rarpd.c,v 1.25 1998/04/23 02:48:33 mrg Exp $ */
/*
@@ -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();
@@ -247,7 +253,7 @@ init_all(void)
void
usage(void)
{
- (void) fprintf(stderr, "usage: rarpd [-adflt] interface\n");
+ (void) fprintf(stderr, "usage: rarpd [-adflt] if0 [... ifN]\n");
exit(1);
}