Re: [RFC] ifconfig description support in rc.d

From: Hiroki Sato <hrs_at_FreeBSD.org>
Date: Mon, 11 Oct 2010 19:29:14 +0900 (JST)
Hi,

pluknet <pluknet_at_gmail.com> wrote
  in <AANLkTintgji3vzrb8XuUQHWp+7YDvHtd7ynP0MmV0oZr_at_mail.gmail.com>:

pl> On 27 August 2010 00:09, Doug Barton <dougb_at_freebsd.org> wrote:
pl> > On 08/26/2010 12:53 PM, pluknet wrote:
pl> >>
pl> >> [cc'ing current_at_ as rc_at_ 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 patch 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> >> +       # ifconfig_IF_descr
pl> >> +       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


Received on Mon Oct 11 2010 - 08:29:44 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:08 UTC