Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Dec 2009 18:23:51 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r200265 - in stable/8: etc/defaults etc/rc.d share/man/man5
Message-ID:  <200912081823.nB8INppk095763@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



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