From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 18:23:51 2009 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 79F0F106566B; Tue, 8 Dec 2009 18:23:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67D398FC0A; Tue, 8 Dec 2009 18:23:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB8INpc1095768; Tue, 8 Dec 2009 18:23:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8INppk095763; Tue, 8 Dec 2009 18:23:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912081823.nB8INppk095763@svn.freebsd.org> From: Xin LI Date: Tue, 8 Dec 2009 18:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200265 - in stable/8: etc/defaults etc/rc.d share/man/man5 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: Tue, 08 Dec 2009 18:23:51 -0000 Author: delphij Date: Tue Dec 8 18:23:51 2009 New Revision: 200265 URL: http://svn.freebsd.org/changeset/base/200265 Log: MFC revisions 196550 and 196552: Add a new rc.d script, static_arp, which enables the administrator to statically bind IPv4 <-> MAC address at boot time. In order to use this, the administrator needs to configure the following rc.conf(5) variable: - static_arp_pairs: A list of names for static bind pairs, and, - a series of static_arp_(name): the arguments that is being passed to ``arp -S'' operation. Example: static_arp_pairs="gw" static_arp_gw="192.168.1.1 00:01:02:03:04:05" See the rc.conf(5) manual page for more details. Added: stable/8/etc/rc.d/static_arp - copied, changed from r196550, head/etc/rc.d/static_arp Modified: stable/8/etc/defaults/rc.conf stable/8/etc/rc.d/Makefile stable/8/share/man/man5/rc.conf.5 Directory Properties: stable/8/etc/ (props changed) stable/8/share/man/man5/ (props changed) Modified: stable/8/etc/defaults/rc.conf ============================================================================== --- stable/8/etc/defaults/rc.conf Tue Dec 8 17:54:23 2009 (r200264) +++ stable/8/etc/defaults/rc.conf Tue Dec 8 18:23:51 2009 (r200265) @@ -358,6 +358,7 @@ bsnmpd_flags="" # Flags for bsnmpd. ### Network routing options: ### defaultrouter="NO" # Set to default gateway (or NO). +static_arp_pairs="" # Set to static ARP list (or leave empty). static_routes="" # Set to static route list (or leave empty). natm_static_routes="" # Set to static route list for NATM (or leave empty). gateway_enable="NO" # Set to YES if this host will be a gateway. Modified: stable/8/etc/rc.d/Makefile ============================================================================== --- stable/8/etc/rc.d/Makefile Tue Dec 8 17:54:23 2009 (r200264) +++ stable/8/etc/rc.d/Makefile Tue Dec 8 18:23:51 2009 (r200265) @@ -32,7 +32,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI random rarpd resolv rfcomm_pppd_server root \ route6d routed routing rpcbind rtadvd rwho \ savecore sdpd securelevel sendmail \ - serial sppp statd swap1 \ + serial sppp statd static_arp swap1 \ syscons sysctl syslogd \ timed tmp \ ugidfw \ Copied and modified: stable/8/etc/rc.d/static_arp (from r196550, head/etc/rc.d/static_arp) ============================================================================== --- head/etc/rc.d/static_arp Tue Aug 25 19:07:26 2009 (r196550, copy source) +++ stable/8/etc/rc.d/static_arp Tue Dec 8 18:23:51 2009 (r200265) @@ -41,10 +41,11 @@ stop_cmd="static_arp_stop" static_arp_start() { + local e arp_args + if [ -n "${static_arp_pairs}" ]; then echo -n 'Binding static ARP pair(s):' for e in ${static_arp_pairs}; do - local arp_args echo -n " ${e}" eval arp_args=\$static_arp_${e} arp -S ${arp_args} >/dev/null 2>&1 @@ -55,10 +56,11 @@ static_arp_start() static_arp_stop() { + local e arp_args + if [ -n "${static_arp_pairs}" ]; then echo -n 'Unbinding static ARP pair(s):' for e in ${static_arp_pairs}; do - local arp_args echo -n " ${e}" eval arp_args=\$static_arp_${e} arp -d ${arp_args%%[ ]*} > /dev/null 2>&1 Modified: stable/8/share/man/man5/rc.conf.5 ============================================================================== --- stable/8/share/man/man5/rc.conf.5 Tue Dec 8 17:54:23 2009 (r200264) +++ stable/8/share/man/man5/rc.conf.5 Tue Dec 8 18:23:51 2009 (r200265) @@ -2237,6 +2237,22 @@ name server!). .Pq Vt str The IPv6 equivalent of .Va defaultrouter . +.It Va static_arp_pairs +.Pq Vt str +Set to the list of static ARP pairs that are to be added at system +boot time. +For each whitespace separated +.Ar element +in the value, a +.Va static_arp_ Ns Aq Ar element +variable is assumed to exist whose contents will later be passed to a +.Dq Nm arp Cm -S +operation. +For example +.Bd -literal +static_arp_pairs="gw" +static_arp_gw="192.168.1.1 00:01:02:03:04:05" +.Ed .It Va static_routes .Pq Vt str Set to the list of static routes that are to be added at system