Bug 102502 - [netgraph] [patch] ifconfig name does't rename netgraph node in network.subr
Summary: [netgraph] [patch] ifconfig name does't rename netgraph node in network.subr
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-25 12:10 UTC by Aleksey Shirokih
Modified: 2018-01-03 05:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aleksey Shirokih 2006-08-25 12:10:24 UTC
ifconfig fxp0 name lan 
ifconfig lan 
lan: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=b<RXCSUM,TXCSUM,VLAN_MTU>
        inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
        ether 00:07:e9:2a:a5:a0
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active

ngctl list 
 Name: fxp0             Type: ether           ID: 00000001   Num hooks: 1

as we can see ifconfig does not renames netgraph node 
so if we start mpd pppoe on lan iface it wil not find any interface to work

Fix: 

in /etc/network.subr add that litle patch 

# ifnet_rename
#       Rename all requested interfaces.
#
ifnet_rename()
{

        _ifn_list="`ifconfig -l`"
        [ -z "$_ifn_list" ] && return 0
        for _if in ${_ifn_list} ; do
                eval _ifname=\$ifconfig_${_if}_name
                if [ ! -z "$_ifname" ]; then
                        ifconfig $_if name $_ifname
                        #olc patch 
                        /usr/sbin/ngctl name $_if: $_ifname
                fi
        done
        return 0
}

in c code i not well enougth so no fix avalaible
How-To-Repeat: please watch higher
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2006-08-26 00:06:19 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-rc

Over to maintainer(s).
Comment 2 ru freebsd_committer 2006-08-26 15:26:25 UTC
On Fri, Aug 25, 2006 at 11:05:02AM +0000, Aleksey Shirokih wrote:
> 
> >Number:         102502
> >Category:       conf
> >Synopsis:       ifconfig name does't rename netgraph node
> 
ng_ether(4) creates all nodes when it's loaded, or when a new
interface is attached, and it *attempts* to name a node with
its interface's name.  This is not guaranteed though.

If you need to rename interfaces, you can load ng_ether module
*after* doing the renames.  It's not ideal, e.g., it'll still
require manual intervention if a new interface is plugged, but
I don't think that automatic renaming of nodes should happen,
unconditionally.


Cheers,
-- 
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer
Comment 3 Gleb Smirnoff freebsd_committer 2006-08-28 10:28:18 UTC
On Sat, Aug 26, 2006 at 06:26:25PM +0400, Ruslan Ermilov wrote:
R> > >Number:         102502
R> > >Category:       conf
R> > >Synopsis:       ifconfig name does't rename netgraph node
R> > 
R> ng_ether(4) creates all nodes when it's loaded, or when a new
R> interface is attached, and it *attempts* to name a node with
R> its interface's name.  This is not guaranteed though.
R> 
R> If you need to rename interfaces, you can load ng_ether module
R> *after* doing the renames.  It's not ideal, e.g., it'll still
R> require manual intervention if a new interface is plugged, but
R> I don't think that automatic renaming of nodes should happen,
R> unconditionally.

I doubt that the problem shouldn't be fixed.

And this is a duplicate of kern/92270.

-- 
Totus tuus, Glebius.
GLEBIUS-RIPN GLEB-RIPE
Comment 4 Brooks Davis freebsd_committer 2006-08-28 13:49:02 UTC
Responsible Changed
From-To: freebsd-rc->freebsd-net

While the proposed workaround is in network.subr, it's not committable 
and the real issue is in the kernel.
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:47 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped