Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Oct 2010 19:29:14 +0900 (JST)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        pluknet@gmail.com
Cc:        freebsd-current@FreeBSD.org, dougb@FreeBSD.org, freebsd-rc@FreeBSD.org
Subject:   Re: [RFC] ifconfig description support in rc.d
Message-ID:  <20101011.192914.82309657.hrs@allbsd.org>
In-Reply-To: <AANLkTintgji3vzrb8XuUQHWp%2B7YDvHtd7ynP0MmV0oZr@mail.gmail.com>
References:  <AANLkTinfOSQGnk0%2BPK6iM0=v5CZn2vcmJZbA8TvgGbfr@mail.gmail.com> <4C76CA06.5010001@FreeBSD.org> <AANLkTintgji3vzrb8XuUQHWp%2B7YDvHtd7ynP0MmV0oZr@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
----Security_Multipart(Mon_Oct_11_19_29_14_2010_564)--
Content-Type: Text/Plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,

pluknet <pluknet@gmail.com> wrote
  in <AANLkTintgji3vzrb8XuUQHWp+7YDvHtd7ynP0MmV0oZr@mail.gmail.com>:

pl> On 27 August 2010 00:09, Doug Barton <dougb@freebsd.org> wrote:
pl> > On 08/26/2010 12:53 PM, pluknet wrote:
pl> >>
pl> >> [cc'ing current@ as rc@ looks too quite]
pl> >>
pl> >> Hi.
pl> >>
pl> >> Since ifconfig has grown to label interfaces with
pl> >> ifconfig $ifname description "foobar", what about
pl> >> to give it more life and store i/face descriptions
pl> >> semi-permanently, so they will survive between reboots?
pl> >>
pl> >> This patch adds a functionality to rc.d to label
pl> >> interfaces at boot time.
pl> >>
pl> >> Comments are welcome.
pl> >
pl> > This seems like a good addition, thanks. Please also write a patc=
h for
pl> > rc.conf.5 to describe this new functionality and I'll be happy to=
 commit it.
pl> =

pl> Xin Li helped me with updating rc.conf.5 (thanks!).
pl> It's included in attached patch.
(snip)
pl> >> + =A0 =A0 =A0 # ifconfig_IF_descr
pl> >> + =A0 =A0 =A0 for _if in `ifconfig -l`; do

 I think using "ifconfig -l" here is not a good idea.  Setting a
 description for each interface in a function invoked by ifn_start()
 would be better.

 This is beacuse the netif script can be run not only at boottime but
 also via devd or by hand for a specific interface.  So, if the
 ifnet_descr is there, "/etc/rc.d/netif start IF" does not make it
 run.  Since the description is a per-interface property,
 "/etc/rc.d/netif start IF" should set one, and "/etc/rc.d/netif stop
 IF" should clear one, IMHO.

 Also, "ifconfig -l" is not compatible with $network_interfaces, so
 you need to use list_net_interface() for that purpose instead (if you
 move ifnet_descr() into ifn_start() it is useless, though).

-- Hiroki


----Security_Multipart(Mon_Oct_11_19_29_14_2010_564)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEABECAAYFAkyy5voACgkQTyzT2CeTzy3yDgCgwGGsv/3cH6Ayycz4Yi4hsaYw
rmMAnjEngZlkiYgjmOr/t4m48P91GtYv
=ilJ8
-----END PGP SIGNATURE-----

----Security_Multipart(Mon_Oct_11_19_29_14_2010_564)----



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