Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Apr 2009 22:04:45 +0000 (UTC)
From:      Tom Rhodes <trhodes@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r190660 - stable/7/usr.sbin/arp
Message-ID:  <200904022204.n32M4jiL077584@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trhodes
Date: Thu Apr  2 22:04:44 2009
New Revision: 190660
URL: http://svn.freebsd.org/changeset/base/190660

Log:
  nt a warning when blackhole and reject are used together.
  Update arp.8 manual page syntax.
  
  PR:		125896
  Submitted by:	Marc Olzheim <marcolz@stack.nl>
  Approved by:	re (kib), sam

Modified:
  stable/7/usr.sbin/arp/   (props changed)
  stable/7/usr.sbin/arp/arp.8
  stable/7/usr.sbin/arp/arp.c

Modified: stable/7/usr.sbin/arp/arp.8
==============================================================================
--- stable/7/usr.sbin/arp/arp.8	Thu Apr  2 21:58:34 2009	(r190659)
+++ stable/7/usr.sbin/arp/arp.8	Thu Apr  2 22:04:44 2009	(r190660)
@@ -28,7 +28,7 @@
 .\"     @(#)arp.8	8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd March 18, 2008
+.Dd December 25, 2008
 .Dt ARP 8
 .Os
 .Sh NAME
@@ -53,14 +53,12 @@
 .Nm
 .Fl s Ar hostname ether_addr
 .Op Cm temp
-.Op Cm reject
-.Op Cm blackhole
+.Op Cm blackhole No \&| Cm reject
 .Op Cm pub Op Cm only
 .Nm
 .Fl S Ar hostname ether_addr
 .Op Cm temp
-.Op Cm reject
-.Op Cm blackhole
+.Op Cm blackhole No \&| Cm reject
 .Op Cm pub Op Cm only
 .Nm
 .Fl f Ar filename
@@ -182,7 +180,8 @@ in the file should be of the form
 .Bd -ragged -offset indent -compact
 .Ar hostname ether_addr
 .Op Cm temp
-.Op Cm pub
+.Op Cm blackhole No \&| Cm reject
+.Op Cm pub Op Cm only
 .Ed
 .Pp
 with argument meanings as given above.

Modified: stable/7/usr.sbin/arp/arp.c
==============================================================================
--- stable/7/usr.sbin/arp/arp.c	Thu Apr  2 21:58:34 2009	(r190659)
+++ stable/7/usr.sbin/arp/arp.c	Thu Apr  2 22:04:44 2009	(r190660)
@@ -330,8 +330,14 @@ set(int argc, char **argv)
 				argc--; argv++;
 			}
 		} else if (strncmp(argv[0], "blackhole", 9) == 0) {
+			if (flags & RTF_REJECT) {
+				printf("Choose one of blackhole or reject, not both.\n");
+			}
 			flags |= RTF_BLACKHOLE;
 		} else if (strncmp(argv[0], "reject", 6) == 0) {
+			if (flags & RTF_BLACKHOLE) {
+				printf("Choose one of blackhole or reject, not both.\n");
+			}
 			flags |= RTF_REJECT;
 		} else if (strncmp(argv[0], "trail", 5) == 0) {
 			/* XXX deprecated and undocumented feature */
@@ -630,8 +636,8 @@ usage(void)
 		"       arp [-n] [-i interface] -a",
 		"       arp -d hostname [pub]",
 		"       arp -d [-i interface] -a",
-		"       arp -s hostname ether_addr [temp] [reject] [blackhole] [pub [only]]",
-		"       arp -S hostname ether_addr [temp] [reject] [blackhole] [pub [only]]",
+		"       arp -s hostname ether_addr [temp] [reject | blackhole] [pub [only]]",
+		"       arp -S hostname ether_addr [temp] [reject | blackhole] [pub [only]]",
 		"       arp -f filename");
 	exit(1);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904022204.n32M4jiL077584>