Date: Sun, 20 Nov 2022 17:37:00 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 102502] [netgraph] [patch] ifconfig name does't rename netgraph node in network.subr Message-ID: <bug-102502-227-6jTZ5Fbe3J@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-102502-227@https.bugs.freebsd.org/bugzilla/> References: <bug-102502-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D102502 Aleksandr Fedorov <afedorov@FreeBSD.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |afedorov@FreeBSD.org --- Comment #7 from Aleksandr Fedorov <afedorov@FreeBSD.org> --- I think thi bug should be closed. root@xenon:/home/XeNoN # ifconfig tap create tap0 root@xenon:/home/XeNoN # ngctl ls There are 5 total nodes: Name: ngeth0 Type: eiface ID: 00000002 Num hooks: 1 Name: ngeth1 Type: eiface ID: 00000004 Num hooks: 1 Name: re0 Type: ether ID: 00000006 Num hooks: 0 Name: tap0 Type: ether ID: 0000000a Num hooks: 0 Name: ngctl44711 Type: socket ID: 0000000b Num hooks: 0 root@xenon:/home/XeNoN # ifconfig tap0 name renamed0 renamed0 root@xenon:/home/XeNoN # ngctl ls There are 5 total nodes: Name: ngeth0 Type: eiface ID: 00000002 Num hooks: 1 Name: ngeth1 Type: eiface ID: 00000004 Num hooks: 1 Name: re0 Type: ether ID: 00000006 Num hooks: 0 Name: renamed0 Type: ether ID: 0000000a Num hooks: 0 Name: ngctl44841 Type: socket ID: 0000000c Num hooks: 0 root@xenon:/home/XeNoN #=20 ng_ether: * * Interface arrival notification handler. * The notification is produced in two cases: * o a new interface arrives * o an existing interface got renamed * Currently the first case is handled by ng_ether_attach via special * hook ng_ether_attach_p. */ static void ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) { char name[IFNAMSIZ]; node_p node; /* Only ethernet interfaces are of interest. */ if (ifp->if_type !=3D IFT_ETHER && ifp->if_type !=3D IFT_L2VLAN && ifp->if_type !=3D IFT_BRIDGE) return; /* * Just return if it's a new interface without an ng_ether companio= n. */ node =3D IFP2NG(ifp); if (node =3D=3D NULL) return; /* Try to give the node the same name as the new interface name */ ng_ether_sanitize_ifname(ifp->if_xname, name); if (ng_name_node(node, name) !=3D 0) log(LOG_WARNING, "%s: can't re-name node %s\n", __func__, name); } --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-102502-227-6jTZ5Fbe3J>