From owner-svn-src-all@FreeBSD.ORG Thu Dec 25 06:44:20 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 087C51065676; Thu, 25 Dec 2008 06:44:20 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB91F8FC13; Thu, 25 Dec 2008 06:44:19 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBP6iJJ1005788; Thu, 25 Dec 2008 06:44:19 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBP6iJq3005786; Thu, 25 Dec 2008 06:44:19 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200812250644.mBP6iJq3005786@svn.freebsd.org> From: Tom Rhodes Date: Thu, 25 Dec 2008 06:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186485 - head/usr.sbin/arp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Dec 2008 06:44:20 -0000 Author: trhodes Date: Thu Dec 25 06:44:19 2008 New Revision: 186485 URL: http://svn.freebsd.org/changeset/base/186485 Log: Print a warning when blackhole and reject are used together. Update arp.8 manual page syntax. PR: 125896 Submitted by: Marc Olzheim Approved by: sam Modified: head/usr.sbin/arp/arp.8 head/usr.sbin/arp/arp.c Modified: head/usr.sbin/arp/arp.8 ============================================================================== --- head/usr.sbin/arp/arp.8 Thu Dec 25 04:29:40 2008 (r186484) +++ head/usr.sbin/arp/arp.8 Thu Dec 25 06:44:19 2008 (r186485) @@ -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: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Thu Dec 25 04:29:40 2008 (r186484) +++ head/usr.sbin/arp/arp.c Thu Dec 25 06:44:19 2008 (r186485) @@ -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 */ @@ -648,8 +654,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); }