Hi,

pluknet <pluk...@gmail.com> wrote
  in <aanlktintgji3vzrb8xuuqhwp+7ydvhtd7ynp0mmv0...@mail.gmail.com>:

pl> On 27 August 2010 00:09, Doug Barton <do...@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 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

Attachment: pgpvMmS5Le8b3.pgp
Description: PGP signature

Reply via email to