From owner-freebsd-rc@FreeBSD.ORG Sun Aug 23 05:52:04 2009 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4277D1065672; Sun, 23 Aug 2009 05:52:04 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1AAEB8FC0A; Sun, 23 Aug 2009 05:52:04 +0000 (UTC) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7N5q31M087499; Sun, 23 Aug 2009 05:52:03 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7N5q3IL087495; Sun, 23 Aug 2009 05:52:03 GMT (envelope-from linimon) Date: Sun, 23 Aug 2009 05:52:03 GMT Message-Id: <200908230552.n7N5q3IL087495@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: conf/138087: [patch] fix typo in etc/rc.d/ipsec X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2009 05:52:04 -0000 Old Synopsis: fix typo in etc/rc.d/ipsec New Synopsis: [patch] fix typo in etc/rc.d/ipsec Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: linimon Responsible-Changed-When: Sun Aug 23 05:51:41 UTC 2009 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=138087 From owner-freebsd-rc@FreeBSD.ORG Sun Aug 23 05:58:07 2009 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E27151065672; Sun, 23 Aug 2009 05:58:07 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B9C6A8FC0C; Sun, 23 Aug 2009 05:58:07 +0000 (UTC) Received: from freefall.freebsd.org (dougb@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7N5w7Jf087640; Sun, 23 Aug 2009 05:58:07 GMT (envelope-from dougb@freefall.freebsd.org) Received: (from dougb@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7N5w7CD087636; Sun, 23 Aug 2009 05:58:07 GMT (envelope-from dougb) Date: Sun, 23 Aug 2009 05:58:07 GMT Message-Id: <200908230558.n7N5w7CD087636@freefall.freebsd.org> To: c.petrik.sosa@gmail.com, dougb@FreeBSD.org, freebsd-rc@FreeBSD.org, dougb@FreeBSD.org From: dougb@FreeBSD.org Cc: Subject: Re: conf/138087: [patch] fix typo in etc/rc.d/ipsec X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2009 05:58:08 -0000 Synopsis: [patch] fix typo in etc/rc.d/ipsec State-Changed-From-To: open->patched State-Changed-By: dougb State-Changed-When: Sun Aug 23 05:54:37 UTC 2009 State-Changed-Why: Thanks for your interest in making FreeBSD better! I've patched this in HEAD but I don't plan to MFC it until after the upcoming 8.0 release so please be patient. Doug Responsible-Changed-From-To: freebsd-rc->dougb Responsible-Changed-By: dougb Responsible-Changed-When: Sun Aug 23 05:54:37 UTC 2009 Responsible-Changed-Why: I'll handle this one. http://www.freebsd.org/cgi/query-pr.cgi?pr=138087 From owner-freebsd-rc@FreeBSD.ORG Mon Aug 24 11:07:03 2009 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65F371065693 for ; Mon, 24 Aug 2009 11:07:03 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5461E8FC19 for ; Mon, 24 Aug 2009 11:07:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7OB73t7048715 for ; Mon, 24 Aug 2009 11:07:03 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7OB72Es048711 for freebsd-rc@FreeBSD.org; Mon, 24 Aug 2009 11:07:02 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 24 Aug 2009 11:07:02 GMT Message-Id: <200908241107.n7OB72Es048711@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-rc@FreeBSD.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2009 11:07:03 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/137629 rc [rc] background_dhclient rc.conf option causing double o conf/137470 rc [PATCH] /etc/rc.d/mdconfig2 : prioritize cli parameter o conf/136875 rc [request] _flags appending o conf/136624 rc [rc.d] sysctl variables for ipnat are not applied on b o conf/134918 rc rc.subr fails to detect perl daemons o conf/134660 rc [patch] rc-script for initializing ng_netflow+ng_ipfw o conf/134333 rc PPP configuration problem in the rc.d scripts in combi o conf/134006 rc [patch] Unload console screensaver kernel modules if s o conf/133987 rc [rc.d] defaultroute broken with DHCP in some cases o conf/133890 rc [patch] sshd(8): add multiple profiles to the rc.d scr o conf/132766 rc wait_for_pids() in /etc/rc.subr is dull. o conf/132483 rc rc.subr(8) [patch] setfib(1) support for rc.subr o conf/132476 rc [rc.d] [patch] add support setfib(1) in rc.d/routing o conf/130414 rc [patch] rc services started with onestart are not stop o conf/128299 rc [patch] /etc/rc.d/geli does not mount partitions using o conf/127917 rc [patch] dumpon rejects on start with physmem>swap even o bin/126562 rc rcorder(8) fails to run unrelated startup scripts when o conf/126392 rc [patch] rc.conf ifconfig_xx keywords cannot be escaped o bin/126324 rc [patch] rc.d/tmp: Prevent mounting /tmp in second tim o conf/124747 rc [patch] savecore can't create dump from encrypted swap o conf/124248 rc [jail] [patch] add support for nice value for rc.d/jai o conf/123734 rc [patch] Chipset VIA CX700 requires extra initializatio o conf/123222 rc [patch] Add rtprio(1)/idprio(1) support to rc.subr(8). o conf/122477 rc [patch] /etc/rc.d/mdconfig and mdconfig2 are ignoring o conf/122170 rc [patch] [request] New feature: notify admin via page o o kern/121566 rc [nfs] [request] [patch] ethernet iface should be broug o conf/120431 rc [patch] devfs.rules are not initialized under certain o conf/120406 rc [devd] [patch] Handle newly attached pcm devices (eg. o conf/120228 rc [zfs] [patch] Split ZFS volume startup / ease ZFS swap o conf/119874 rc [patch] "/etc/rc.d/pf reload" fails if there are macro o conf/119076 rc [patch] [rc.d] /etc/rc.d/netif tries to remove alias a o bin/118325 rc [patch] [request] new periodic script to test statuses o conf/118255 rc savecore never finding kernel core dumps (rcorder prob o conf/117935 rc [patch] ppp fails to start at boot because of missing o conf/113915 rc [patch] ndis wireless driver fails to associate when i o conf/109980 rc /etc/rc.d/netif restart doesn't destroy cloned_interfa o conf/109562 rc [rc.d] [patch] [request] Make rc.d/devfs usable from c o conf/108589 rc rtsol(8) fails due to default ipfw rules o conf/106009 rc [ppp] [patch] [request] Fix pppoed startup script to p o conf/105689 rc [ppp] [request] syslogd starts too late at boot o conf/105568 rc [patch] [request] Add more flexibility to rc.conf, to o conf/105145 rc [ppp] [patch] [request] add redial function to rc.d/pp o conf/104549 rc [patch] rc.d/nfsd needs special _find_processes functi o conf/102700 rc [geli] [patch] Add encrypted /tmp support to GELI/GBDE o conf/99721 rc [patch] /etc/rc.initdiskless problem copy dotfile in s o conf/99444 rc [patch] Enhancement: rc.subr could easily support star o conf/96343 rc [patch] rc.d order change to start inet6 before pf o conf/93815 rc [patch] Adds in the ability to save ipfw rules to rc.d o conf/92523 rc [patch] allow rc scripts to kill process after a timeo o conf/89870 rc [patch] [request] make netif verbose rc.conf toggle o conf/89061 rc [patch] IPv6 6to4 auto-configuration enhancement o conf/88913 rc [patch] wrapper support for rc.subr o conf/85819 rc [patch] script allowing multiuser mode in spite of fsc o kern/81006 rc ipnat not working with tunnel interfaces on startup o conf/77663 rc Suggestion: add /etc/rc.d/addnetswap after addcritremo o conf/73677 rc [patch] add support for powernow states to power_profi o conf/58939 rc [patch] dumb little hack for /etc/rc.firewall{,6} o conf/56934 rc [patch] rc.firewall rules for natd expect an interface o conf/45226 rc [patch] Fix for rc.network, ppp-user annoyance o conf/44170 rc [patch] Add ability to run multiple pppoed(8) on start 60 problems total. From owner-freebsd-rc@FreeBSD.ORG Tue Aug 25 00:40:10 2009 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0985C106564A; Tue, 25 Aug 2009 00:40:10 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 4C2F88FC26; Tue, 25 Aug 2009 00:40:09 +0000 (UTC) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 6C40A5C025; Tue, 25 Aug 2009 08:40:08 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 2A2CA55CDCF6; Tue, 25 Aug 2009 08:40:08 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id eKNhD3gnvNrQ; Tue, 25 Aug 2009 08:39:09 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 5F5FA55CDCF3; Tue, 25 Aug 2009 08:39:02 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type; b=E6ajRciV2cib6w5Yq/oYZpmfeKpVIDeGK/hTAcWMg1D1eWFy1plHI4nRY0Os/iQQH dYSMYww97DHf925++AF5g== Message-ID: <4A933294.8000906@delphij.net> Date: Mon, 24 Aug 2009 17:38:44 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.22 (X11/20090803) MIME-Version: 1.0 To: d@delphij.net References: <4A7B2792.4090803@delphij.net> <4A7B487B.8060303@FreeBSD.org> <4A7F948A.2040602@delphij.net> <4A7F9EC6.9090605@FreeBSD.org> <4A7FAA42.4030607@delphij.net> <78cb3d3f0908101113s412021adk8956dd083a8fed72@mail.gmail.com> <4A806D17.9020404@delphij.net> In-Reply-To: <4A806D17.9020404@delphij.net> X-Enigmail-Version: 0.96.0 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: multipart/mixed; boundary="------------090903030705040904000507" Cc: freebsd-rc@freebsd.org, Doug Barton Subject: Re: [RFC] script for binding ARP <-> IP pairs X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 00:40:10 -0000 This is a multi-part message in MIME format. --------------090903030705040904000507 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Any objections for the attached patch? I'll commit this version if everybody is happy with it and then see if re@ would approve it for 8.0-RELEASE. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkqTMpQACgkQi+vbBBjt66CoRQCgwRQaFjKsZE8+jj/CXGdl0I8n 74oAn0ptg/pwgHSDmw9iUbQcEXlJULhu =UvH8 -----END PGP SIGNATURE----- --------------090903030705040904000507 Content-Type: text/plain; name="staticarp-20090824.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="staticarp-20090824.diff" Index: etc/defaults/rc.conf =================================================================== --- etc/defaults/rc.conf (revision 196516) +++ etc/defaults/rc.conf (working copy) @@ -357,6 +357,7 @@ ### 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. Index: etc/rc.d/Makefile =================================================================== --- etc/rc.d/Makefile (revision 196516) +++ etc/rc.d/Makefile (working copy) @@ -32,7 +32,7 @@ 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 \ Index: etc/rc.d/static_arp =================================================================== --- etc/rc.d/static_arp (revision 0) +++ etc/rc.d/static_arp (revision 0) @@ -0,0 +1,69 @@ +#!/bin/sh +# +# Copyright (c) 2009 Xin LI +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# Configure static ARP table +# +# $FreeBSD$ +# + +# PROVIDE: static_arp +# REQUIRE: netif +# KEYWORD: nojail + +. /etc/rc.subr + +name="static_arp" +start_cmd="static_arp_start" +stop_cmd="static_arp_stop" + +static_arp_start() +{ + if [ -n "${static_arp_pairs}" ]; then + echo -n 'Binding static ARP pair(s):' + for e in ${static_arp_pairs}; do + echo -n " ${e}" + eval arp_args=\$arp_${e} + arp -S ${arp_args} >/dev/null 2>&1 + done + echo '.' + fi +} + +static_arp_stop() +{ + if [ -n "${static_arp_pairs}" ]; then + echo -n 'Unbinding static ARP pair(s):' + for e in ${static_arp_pairs}; do + echo -n " ${e}" + eval arp_args=\$arp_${e} + arp -d ${arp_args%%[ ]*} > /dev/null 2>&1 + done + echo '.' + fi +} + +load_rc_config $name +run_rc_command "$1" Index: share/man/man5/rc.conf.5 =================================================================== --- share/man/man5/rc.conf.5 (revision 196516) +++ share/man/man5/rc.conf.5 (working copy) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2009 +.Dd August 10, 2009 .Dt RC.CONF 5 .Os .Sh NAME @@ -2227,6 +2227,23 @@ .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 +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" +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 --------------090903030705040904000507-- From owner-freebsd-rc@FreeBSD.ORG Tue Aug 25 00:49:44 2009 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 622BF1065695 for ; Tue, 25 Aug 2009 00:49:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id E79618FC14 for ; Tue, 25 Aug 2009 00:49:43 +0000 (UTC) Received: (qmail 12115 invoked by uid 399); 25 Aug 2009 00:49:40 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 25 Aug 2009 00:49:40 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4A93351E.2020107@FreeBSD.org> Date: Mon, 24 Aug 2009 17:49:34 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: d@delphij.net References: <4A7B2792.4090803@delphij.net> <4A7B487B.8060303@FreeBSD.org> <4A7F948A.2040602@delphij.net> <4A7F9EC6.9090605@FreeBSD.org> <4A7FAA42.4030607@delphij.net> <78cb3d3f0908101113s412021adk8956dd083a8fed72@mail.gmail.com> <4A806D17.9020404@delphij.net> <4A933294.8000906@delphij.net> In-Reply-To: <4A933294.8000906@delphij.net> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: [RFC] script for binding ARP <-> IP pairs X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 00:49:44 -0000 Xin LI wrote: > Any objections for the attached patch? I'll commit this version if > everybody is happy with it and then see if re@ would approve it for > 8.0-RELEASE. Sorry if I wasn't clear before, but all of the rc.conf variables should be prepended with static_arp_ (as opposed to just arp_). So rather than arp_args you'd want static_arp_args. I realize you're not using set_rcvar() but it's still a good idea to do that for consistency's sake, as well as to make it easier for admins to sort stuff, etc. Please make sure you change that in the man page as well. Other than that it looks fine to me. Silly question that I'm sorry just occurred to me right now, have you tested this with IPv6? :) Doug -- This .signature sanitized for your protection From owner-freebsd-rc@FreeBSD.ORG Tue Aug 25 00:57:40 2009 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02F81106568C; Tue, 25 Aug 2009 00:57:40 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id 812A48FC12; Tue, 25 Aug 2009 00:57:39 +0000 (UTC) Received: from delta.allbsd.org (p4121-ipbf1805funabasi.chiba.ocn.ne.jp [114.146.83.121]) (authenticated bits=128) by mail.allbsd.org (8.14.3/8.14.3) with ESMTP id n7P0vJHQ073124; Tue, 25 Aug 2009 09:57:30 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (alph.allbsd.org [192.168.0.10]) (authenticated bits=0) by delta.allbsd.org (8.13.4/8.13.4) with ESMTP id n7P0v9NJ058303; Tue, 25 Aug 2009 09:57:12 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 25 Aug 2009 09:56:56 +0900 (JST) Message-Id: <20090825.095656.100103076.hrs@allbsd.org> To: dougb@FreeBSD.org From: Hiroki Sato In-Reply-To: <4A93351E.2020107@FreeBSD.org> References: <4A806D17.9020404@delphij.net> <4A933294.8000906@delphij.net> <4A93351E.2020107@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.2.51 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Tue_Aug_25_09_56_56_2009_980)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.95.2 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.2 (mail.allbsd.org [133.31.130.32]); Tue, 25 Aug 2009 09:57:30 +0900 (JST) Cc: freebsd-rc@FreeBSD.org, d@delphij.net Subject: Re: [RFC] script for binding ARP <-> IP pairs X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 00:57:40 -0000 ----Security_Multipart(Tue_Aug_25_09_56_56_2009_980)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Doug Barton wrote in <4A93351E.2020107@FreeBSD.org>: do> Xin LI wrote: do> > Any objections for the attached patch? I'll commit this version if do> > everybody is happy with it and then see if re@ would approve it for do> > 8.0-RELEASE. do> do> Sorry if I wasn't clear before, but all of the rc.conf variables do> should be prepended with static_arp_ (as opposed to just arp_). So do> rather than arp_args you'd want static_arp_args. I realize you're not do> using set_rcvar() but it's still a good idea to do that for do> consistency's sake, as well as to make it easier for admins to sort do> stuff, etc. Please make sure you change that in the man page as well. I agree with this. do> Silly question that I'm sorry just occurred to me right now, have you do> tested this with IPv6? :) IPv6 uses NDP (see ndp(8)), not ARP, so no consideration is needed for $static_arp_* variables at least. -- Hiroki ----Security_Multipart(Tue_Aug_25_09_56_56_2009_980)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkqTNtgACgkQTyzT2CeTzy1RQgCgoI8eVDIzSRi1VE6NriNC0MkE +UoAniivQQydtDeu1Rs6niS8dzKhhVoC =9C3s -----END PGP SIGNATURE----- ----Security_Multipart(Tue_Aug_25_09_56_56_2009_980)---- From owner-freebsd-rc@FreeBSD.ORG Tue Aug 25 01:18:08 2009 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60E9A10656BD; Tue, 25 Aug 2009 01:18:08 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id D01838FC18; Tue, 25 Aug 2009 01:18:06 +0000 (UTC) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 0F5365C06F; Tue, 25 Aug 2009 09:18:06 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id D117755CDCF6; Tue, 25 Aug 2009 09:18:05 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id Dr3ChEPIw5gk; Tue, 25 Aug 2009 09:17:06 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 0DFB755CDCFB; Tue, 25 Aug 2009 09:16:58 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type; b=n5Zb6xw+LqyVikIXUldgLq/VuHSukUliOstZRJkDI1B/oS8Xf/Ao3iNCQ7fYRQajY svr+DHnGakzyxqETVA6WQ== Message-ID: <4A933B77.7030108@delphij.net> Date: Mon, 24 Aug 2009 18:16:39 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.22 (X11/20090803) MIME-Version: 1.0 To: Doug Barton References: <4A7B2792.4090803@delphij.net> <4A7B487B.8060303@FreeBSD.org> <4A7F948A.2040602@delphij.net> <4A7F9EC6.9090605@FreeBSD.org> <4A7FAA42.4030607@delphij.net> <78cb3d3f0908101113s412021adk8956dd083a8fed72@mail.gmail.com> <4A806D17.9020404@delphij.net> <4A933294.8000906@delphij.net> <4A93351E.2020107@FreeBSD.org> In-Reply-To: <4A93351E.2020107@FreeBSD.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: multipart/mixed; boundary="------------030405020800090701040101" Cc: freebsd-rc@freebsd.org, d@delphij.net Subject: Re: [RFC] script for binding ARP <-> IP pairs X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 01:18:08 -0000 This is a multi-part message in MIME format. --------------030405020800090701040101 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Doug Barton wrote: > Xin LI wrote: >> Any objections for the attached patch? I'll commit this version if >> everybody is happy with it and then see if re@ would approve it for >> 8.0-RELEASE. > > Sorry if I wasn't clear before, but all of the rc.conf variables > should be prepended with static_arp_ (as opposed to just arp_). So > rather than arp_args you'd want static_arp_args. I realize you're not > using set_rcvar() but it's still a good idea to do that for > consistency's sake, as well as to make it easier for admins to sort > stuff, etc. Please make sure you change that in the man page as well. I see. I have corrected arp_ prefixes to static_arp_ prefixes. Note that "arp_args" are not changed because they are intermediate variables that are intended as "arp(1) arguments". I have marked these as local. > Other than that it looks fine to me. > > Silly question that I'm sorry just occurred to me right now, have you > tested this with IPv6? :) I think IPv6 would need to use "ndp" instead (cross referenced from arp(8)) but am not sure. Because the script rely on space or tab as separator I think it would just work after a simple s/arp/ndp/g for ndp but I don't have a local production IPv6 network for the test... Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkqTO3cACgkQi+vbBBjt66CtWwCZARUOgOP3AoZEEEeCCXl9ziVT ZwsAoIC1cmv6d0QY7z1RjEoFcfz0Sey/ =py3J -----END PGP SIGNATURE----- --------------030405020800090701040101 Content-Type: text/plain; name="staticarp-20090824a.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="staticarp-20090824a.diff" Index: etc/defaults/rc.conf =================================================================== --- etc/defaults/rc.conf (revision 196516) +++ etc/defaults/rc.conf (working copy) @@ -357,6 +357,7 @@ ### 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. Index: etc/rc.d/Makefile =================================================================== --- etc/rc.d/Makefile (revision 196516) +++ etc/rc.d/Makefile (working copy) @@ -32,7 +32,7 @@ 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 \ Index: etc/rc.d/static_arp =================================================================== --- etc/rc.d/static_arp (revision 0) +++ etc/rc.d/static_arp (revision 0) @@ -0,0 +1,71 @@ +#!/bin/sh +# +# Copyright (c) 2009 Xin LI +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# Configure static ARP table +# +# $FreeBSD$ +# + +# PROVIDE: static_arp +# REQUIRE: netif +# KEYWORD: nojail + +. /etc/rc.subr + +name="static_arp" +start_cmd="static_arp_start" +stop_cmd="static_arp_stop" + +static_arp_start() +{ + 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 + done + echo '.' + fi +} + +static_arp_stop() +{ + 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 + done + echo '.' + fi +} + +load_rc_config $name +run_rc_command "$1" Index: share/man/man5/rc.conf.5 =================================================================== --- share/man/man5/rc.conf.5 (revision 196516) +++ share/man/man5/rc.conf.5 (working copy) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2009 +.Dd August 25, 2009 .Dt RC.CONF 5 .Os .Sh NAME @@ -2227,6 +2227,22 @@ .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 --------------030405020800090701040101-- From owner-freebsd-rc@FreeBSD.ORG Tue Aug 25 14:55:23 2009 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21A73106568D; Tue, 25 Aug 2009 14:55:23 +0000 (UTC) (envelope-from ady@ady.ro) Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com [209.85.219.209]) by mx1.freebsd.org (Postfix) with ESMTP id 5F2558FC26; Tue, 25 Aug 2009 14:55:22 +0000 (UTC) Received: by ewy5 with SMTP id 5so1875712ewy.36 for ; Tue, 25 Aug 2009 07:55:21 -0700 (PDT) MIME-Version: 1.0 Sender: ady@ady.ro Received: by 10.210.37.19 with SMTP id k19mr3713414ebk.52.1251211701604; Tue, 25 Aug 2009 07:48:21 -0700 (PDT) In-Reply-To: <4A933B77.7030108@delphij.net> References: <4A7B2792.4090803@delphij.net> <4A7F948A.2040602@delphij.net> <4A7F9EC6.9090605@FreeBSD.org> <4A7FAA42.4030607@delphij.net> <78cb3d3f0908101113s412021adk8956dd083a8fed72@mail.gmail.com> <4A806D17.9020404@delphij.net> <4A933294.8000906@delphij.net> <4A93351E.2020107@FreeBSD.org> <4A933B77.7030108@delphij.net> Date: Tue, 25 Aug 2009 16:48:21 +0200 X-Google-Sender-Auth: 09ed31d0db89436a Message-ID: <78cb3d3f0908250748j16ff3879y4ea28fd83b0780c0@mail.gmail.com> From: Adrian Penisoara To: d@delphij.net Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Doug Barton , freebsd-rc@freebsd.org Subject: Re: [RFC] script for binding ARP <-> IP pairs X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 14:55:23 -0000 Hi, On Tue, Aug 25, 2009 at 3:16 AM, Xin LI wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Doug Barton wrote: > > Xin LI wrote: > >> Any objections for the attached patch? I'll commit this version if > >> everybody is happy with it and then see if re@ would approve it for > >> 8.0-RELEASE. > > > > Sorry if I wasn't clear before, but all of the rc.conf variables > > should be prepended with static_arp_ (as opposed to just arp_). So > > rather than arp_args you'd want static_arp_args. I realize you're not > > using set_rcvar() but it's still a good idea to do that for > > consistency's sake, as well as to make it easier for admins to sort > > stuff, etc. Please make sure you change that in the man page as well. > For consistency we should leave it as "arp_xxx" like it's currently done for static_routes/route_xxx and ipv6_static_routes/ipv6_route_xxx ... If we want to keep consistency then either leave it as "static_arp_pairs/arp_xxx" or change it to something like "static_arps/arp_xxx > > > I see. I have corrected arp_ prefixes to static_arp_ prefixes. Note > that "arp_args" are not changed because they are intermediate variables > that are intended as "arp(1) arguments". I have marked these as local. > > > Other than that it looks fine to me. > > > > Silly question that I'm sorry just occurred to me right now, have you > > tested this with IPv6? :) > > I think IPv6 would need to use "ndp" instead (cross referenced from > arp(8)) but am not sure. Because the script rely on space or tab as > separator I think it would just work after a simple s/arp/ndp/g for ndp > but I don't have a local production IPv6 network for the test... > > Cheers, > - -- > Xin LI http://www.delphij.net/ > FreeBSD - The Power to Serve! > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.12 (FreeBSD) > > iEYEARECAAYFAkqTO3cACgkQi+vbBBjt66CtWwCZARUOgOP3AoZEEEeCCXl9ziVT > ZwsAoIC1cmv6d0QY7z1RjEoFcfz0Sey/ > =py3J > -----END PGP SIGNATURE----- > > Index: etc/defaults/rc.conf > =================================================================== > --- etc/defaults/rc.conf (revision 196516) > +++ etc/defaults/rc.conf (working copy) > @@ -357,6 +357,7 @@ > > ### 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. > Please add commented line(s) as an example on how to use this, like for ipv6_static_routes: #static_arp_pairs="xxx" # An example to set an ARP static entry #arp_xxx="10.20.30.40 00:11:22:33:44:55" Regards, Adrian Penisoara EnterpriseBSD From owner-freebsd-rc@FreeBSD.ORG Tue Aug 25 17:16:54 2009 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0F70106564A for ; Tue, 25 Aug 2009 17:16:54 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 59CA28FC12 for ; Tue, 25 Aug 2009 17:16:54 +0000 (UTC) Received: (qmail 27950 invoked by uid 399); 25 Aug 2009 17:16:52 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 25 Aug 2009 17:16:52 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4A941C7F.2070503@FreeBSD.org> Date: Tue, 25 Aug 2009 10:16:47 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: d@delphij.net References: <4A7B2792.4090803@delphij.net> <4A7B487B.8060303@FreeBSD.org> <4A7F948A.2040602@delphij.net> <4A7F9EC6.9090605@FreeBSD.org> <4A7FAA42.4030607@delphij.net> <78cb3d3f0908101113s412021adk8956dd083a8fed72@mail.gmail.com> <4A806D17.9020404@delphij.net> <4A933294.8000906@delphij.net> <4A93351E.2020107@FreeBSD.org> <4A933B77.7030108@delphij.net> In-Reply-To: <4A933B77.7030108@delphij.net> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: [RFC] script for binding ARP <-> IP pairs X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 17:16:54 -0000 Xin LI wrote: > Doug Barton wrote: >> Xin LI wrote: >>> Any objections for the attached patch? I'll commit this version if >>> everybody is happy with it and then see if re@ would approve it for >>> 8.0-RELEASE. >> Sorry if I wasn't clear before, but all of the rc.conf variables >> should be prepended with static_arp_ (as opposed to just arp_). So >> rather than arp_args you'd want static_arp_args. I realize you're not >> using set_rcvar() but it's still a good idea to do that for >> consistency's sake, as well as to make it easier for admins to sort >> stuff, etc. Please make sure you change that in the man page as well. > > I see. I have corrected arp_ prefixes to static_arp_ prefixes. Note > that "arp_args" are not changed because they are intermediate variables > that are intended as "arp(1) arguments". I have marked these as local. That look great, commit it when you are ready. :) >> Other than that it looks fine to me. > >> Silly question that I'm sorry just occurred to me right now, have you >> tested this with IPv6? :) > > I think IPv6 would need to use "ndp" instead (cross referenced from > arp(8)) but am not sure. Because the script rely on space or tab as > separator I think it would just work after a simple s/arp/ndp/g for ndp > but I don't have a local production IPv6 network for the test... Sorry, I had intended that as a joke since in general we're trying to achieve parity in IPv6 for the features in IPv4. Looking back it's not even that funny to me anymore .... :) Doug -- This .signature sanitized for your protection From owner-freebsd-rc@FreeBSD.ORG Tue Aug 25 19:23:01 2009 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4AEF106568D for ; Tue, 25 Aug 2009 19:23:01 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 63F7D8FC2B for ; Tue, 25 Aug 2009 19:23:01 +0000 (UTC) Received: (qmail 11777 invoked by uid 399); 25 Aug 2009 19:22:57 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 25 Aug 2009 19:22:57 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4A943A0C.9000305@FreeBSD.org> Date: Tue, 25 Aug 2009 12:22:52 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Adrian Penisoara References: <4A7B2792.4090803@delphij.net> <4A7F948A.2040602@delphij.net> <4A7F9EC6.9090605@FreeBSD.org> <4A7FAA42.4030607@delphij.net> <78cb3d3f0908101113s412021adk8956dd083a8fed72@mail.gmail.com> <4A806D17.9020404@delphij.net> <4A933294.8000906@delphij.net> <4A93351E.2020107@FreeBSD.org> <4A933B77.7030108@delphij.net> <78cb3d3f0908250748j16ff3879y4ea28fd83b0780c0@mail.gmail.com> In-Reply-To: <78cb3d3f0908250748j16ff3879y4ea28fd83b0780c0@mail.gmail.com> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org, d@delphij.net Subject: Re: [RFC] script for binding ARP <-> IP pairs X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 19:23:01 -0000 Adrian Penisoara wrote: >> For consistency we should leave it as "arp_xxx" like it's currently done >> for static_routes/route_xxx and ipv6_static_routes/ipv6_route_xxx ... The fact that there are legacy examples that don't use a consistent prepend is not a reason to add more. Doug -- This .signature sanitized for your protection From owner-freebsd-rc@FreeBSD.ORG Tue Aug 25 21:18:04 2009 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F8C0106568E; Tue, 25 Aug 2009 21:18:04 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 48DA18FC14; Tue, 25 Aug 2009 21:18:04 +0000 (UTC) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 6F0A05C071; Wed, 26 Aug 2009 05:18:03 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 32FF855CDD09; Wed, 26 Aug 2009 05:17:58 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id kvPexa19zUh3; Wed, 26 Aug 2009 05:17:04 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 423CC55CDD0C; Wed, 26 Aug 2009 05:16:58 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=nJT+1EkHjiwEZ2mJaj55hbJiS08+hA4gQ8WCRXstdIZuJk5Ia5GQqvjWKJk35pHsf /N0ge+BXUApVk5609fBfA== Message-ID: <4A9454B2.2040808@delphij.net> Date: Tue, 25 Aug 2009 14:16:34 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.22 (X11/20090803) MIME-Version: 1.0 To: Gleb Kurtsou References: <200908251907.n7PJ7QiO036868@svn.freebsd.org> <20090825194258.GB1471@tops> In-Reply-To: <20090825194258.GB1471@tops> X-Enigmail-Version: 0.96.0 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@FreeBSD.org, Xin LI Subject: Re: svn commit: r196550 - in head: etc/defaults etc/rc.d share/man/man5 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 21:18:04 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [Moved to -rc@] Hi, Gleb, Gleb Kurtsou wrote: [...] > Would you please add support for reading pairs from file, that should be > trivial. I've been using my own rc script for reading static arp entries > from file but can't find it right now. I think it's what 'arp -f' would do. However I didn't found a easy way to revert its effect, do you have some ideas about it or we need to teach arp(8) to do that? Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkqUVLIACgkQi+vbBBjt66CzEgCfa9MShg0JzYxKyA2oFWq3prK6 S7AAn3MGN0QUzRCuPxM2tk5g/hHwvOXR =DrCH -----END PGP SIGNATURE----- From owner-freebsd-rc@FreeBSD.ORG Tue Aug 25 23:51:46 2009 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32421106568B for ; Tue, 25 Aug 2009 23:51:46 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-fx0-f210.google.com (mail-fx0-f210.google.com [209.85.220.210]) by mx1.freebsd.org (Postfix) with ESMTP id B0D1C8FC19 for ; Tue, 25 Aug 2009 23:51:45 +0000 (UTC) Received: by fxm6 with SMTP id 6so2396635fxm.43 for ; Tue, 25 Aug 2009 16:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=S7GTAYV2asEID6HFpE7Hjs/kA0FBkQ4qCcTNA92eIiM=; b=J/EcY7Y9FomLOhXegwS4k2kCLLDQOjUQNeKJmAzP1awYrZOXbOeYM3yReSDovA6prI 9JDmRsWdW5FLxK0M1SHcE5bcv4UucVNj1J5ZjgVecONRja+Ux7xRlBYyACg1LuNrNjL2 Y5e/Z299ZPpwe7tuBWx5fqvYvmC2Gcc+eMxd4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=S5vwkigKs+L5xagd8mljJDBDS8CQe360iATM4kL6awvI0QhxNVkksFzKVp14SCst2M KDPjw6SzHBbrGFcFwH4Ujq4ZJRbSTtMlDzPawUEJVdgWBUFFkZ1CPS+8e3G9Hrvr2a1f y+xN32fpZPB2ZzF4Em9txX/6lKzMQpC5lqNXg= Received: by 10.103.84.1 with SMTP id m1mr3098887mul.34.1251242779199; Tue, 25 Aug 2009 16:26:19 -0700 (PDT) Received: from localhost (lan-78-157-90-54.vln.skynet.lt [78.157.90.54]) by mx.google.com with ESMTPS id s11sm3885028mue.41.2009.08.25.16.26.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 25 Aug 2009 16:26:18 -0700 (PDT) Date: Wed, 26 Aug 2009 02:25:58 +0300 From: Gleb Kurtsou To: d@delphij.net Message-ID: <20090825232558.GA1208@tops> References: <200908251907.n7PJ7QiO036868@svn.freebsd.org> <20090825194258.GB1471@tops> <4A9454B2.2040808@delphij.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="EeQfGwPcQSOJBaQU" Content-Disposition: inline In-Reply-To: <4A9454B2.2040808@delphij.net> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-rc@FreeBSD.org, Xin LI Subject: Re: svn commit: r196550 - in head: etc/defaults etc/rc.d share/man/man5 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 23:51:46 -0000 --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On (25/08/2009 14:16), Xin LI wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > [Moved to -rc@] > > Hi, Gleb, > > Gleb Kurtsou wrote: > [...] > > Would you please add support for reading pairs from file, that should be > > trivial. I've been using my own rc script for reading static arp entries > > from file but can't find it right now. > > I think it's what 'arp -f' would do. However I didn't found a easy way > to revert its effect, do you have some ideas about it or we need to > teach arp(8) to do that? 'arp -f' is just fine it parses all the options arp has for static entries. I was thinking of something like 'static_arp_files' variable. I've added support for 'arg -d -f' in attached patch (man page part is missing), hope it helps. Thanks, Gleb. > > Cheers, > - -- > Xin LI http://www.delphij.net/ > FreeBSD - The Power to Serve! > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.12 (FreeBSD) > > iEYEARECAAYFAkqUVLIACgkQi+vbBBjt66CzEgCfa9MShg0JzYxKyA2oFWq3prK6 > S7AAn3MGN0QUzRCuPxM2tk5g/hHwvOXR > =DrCH > -----END PGP SIGNATURE----- --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="arp-df.txt" diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c index 8a3410f..11d1df6 100644 --- a/usr.sbin/arp/arp.c +++ b/usr.sbin/arp/arp.c @@ -101,7 +101,7 @@ static int valid_type(int type); static int nflag; /* no reverse dns lookups */ static char *rifname; -static int expire_time, flags, doing_proxy, proxy_only; +static int expire_time, flags, func, doing_proxy, proxy_only; /* which function we're supposed to do */ #define F_GET 1 @@ -109,23 +109,28 @@ static int expire_time, flags, doing_proxy, proxy_only; #define F_FILESET 3 #define F_REPLACE 4 #define F_DELETE 5 +#define F_FILEDELETE 6 #define SETFUNC(f) { if (func) usage(); func = (f); } int main(int argc, char *argv[]) { - int ch, func = 0; + int ch; int rtn = 0; int aflag = 0; /* do it for all entries */ + func = 0; while ((ch = getopt(argc, argv, "andfsSi:")) != -1) switch(ch) { case 'a': aflag = 1; break; case 'd': - SETFUNC(F_DELETE); + if (func == F_FILESET) + func = F_FILEDELETE; + else + SETFUNC(F_DELETE); break; case 'n': nflag = 1; @@ -137,7 +142,10 @@ main(int argc, char *argv[]) SETFUNC(F_SET); break; case 'f' : - SETFUNC(F_FILESET); + if (func == F_DELETE) + func = F_FILEDELETE; + else + SETFUNC(F_FILESET); break; case 'i': rifname = optarg; @@ -197,6 +205,7 @@ main(int argc, char *argv[]) } break; case F_FILESET: + case F_FILEDELETE: if (argc != 1) usage(); rtn = file(argv[0]); @@ -213,7 +222,7 @@ static int file(char *name) { FILE *fp; - int i, retval; + int i, j, retval; char line[100], arg[5][50], *args[5], *p; if ((fp = fopen(name, "r")) == NULL) @@ -237,8 +246,23 @@ file(char *name) retval = 1; continue; } - if (set(i, args)) - retval = 1; + switch (func) { + case F_FILESET: + if (set(i, args)) + retval = 1; + break; + case F_FILEDELETE: + for (j = 2; j < i; j++) + if (strncmp(args[j], "pub", 3) == 0) { + j = 0; + break; + } + if (delete(args[0], j == 0 ? SIN_PROXY : 0)) + retval = 1; + break; + default: + usage(); + } } fclose(fp); return (retval); @@ -650,11 +674,12 @@ nuke_entry(struct sockaddr_dl *sdl __unused, static void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", "usage: arp [-n] [-i interface] hostname", " arp [-n] [-i interface] -a", " arp -d hostname [pub]", " arp -d [-i interface] -a", + " arp -d -f filename", " arp -s hostname ether_addr [temp] [reject | blackhole] [pub [only]]", " arp -S hostname ether_addr [temp] [reject | blackhole] [pub [only]]", " arp -f filename"); --EeQfGwPcQSOJBaQU-- From owner-freebsd-rc@FreeBSD.ORG Wed Aug 26 20:48:32 2009 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0328F106564A; Wed, 26 Aug 2009 20:48:32 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CE02B8FC32; Wed, 26 Aug 2009 20:48:31 +0000 (UTC) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7QKmVbS018859; Wed, 26 Aug 2009 20:48:31 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7QKmVqX018855; Wed, 26 Aug 2009 20:48:31 GMT (envelope-from linimon) Date: Wed, 26 Aug 2009 20:48:31 GMT Message-Id: <200908262048.n7QKmVqX018855@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: conf/138208: [rc] [patch] Making rc.firewall (workstation) IPv6 aware X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2009 20:48:32 -0000 Old Synopsis: [patch] Making rc.firewall (workstation) IPv6 aware New Synopsis: [rc] [patch] Making rc.firewall (workstation) IPv6 aware Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: linimon Responsible-Changed-When: Wed Aug 26 20:48:08 UTC 2009 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=138208