Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Mar 2023 13:05:47 -0700
From:      Gleb Smirnoff <glebius@freebsd.org>
To:        Alexander Chernikov <melifaro@freebsd.org>
Cc:        Kristof Provost <kp@freebsd.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@freebsd.org>
Subject:   Re: git: 7e5bf68495cc - main - netlink: add netlink support
Message-ID:  <ZBIlGz%2BrolI6FRmN@FreeBSD.org>
In-Reply-To: <2F410705-A141-49B4-8395-3B39D3EF1C3E@freebsd.org>
References:  <202210011419.291EJ3aa000309@gitrepo.freebsd.org> <3D3095AE-60CC-4CCD-8C8A-A6E53EEB6A8A@FreeBSD.org> <2F410705-A141-49B4-8395-3B39D3EF1C3E@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 09, 2023 at 05:45:50PM +0000, Alexander Chernikov wrote:
A> > So, really fun thing here, we also have #define NETLINK_GENERIC 0 in sys/net/if_mib.h. (And that’s exposed to userspace, and used there, so we can’t just change that.)
A> > 
A> Wow. Thanks for pointing it out - it wasn’t defined in the kernel headers so I missed it.
A> That looks like something FreeBSD-specific. Both NetBSD / OpenBSD doesn’t have it.
A> It seem to provide:
A> - iteration over the list of the interfaces
A> - some basic interface traffic statistics
A> - copy of the ’struct ifdata’ (basic interface properties and some interface traffic statistics)
A> - Link-specific data (IFDATA_LINKSPECIFIC), not used by anything in base
A> - Original “driver name” (IFDATA_DRIVERNAME)
A> 
A> Most of this is already provided by either getifaddr(3) or netlink or even rtsock. I’m thinking of deprecating it in mid-term in favour of Netlink.
A> 
A> I see the following options:
A> 1) Remove usage of if_mib.h from ifconfig
A> 
A> 2) Add compat layer:
A> *) Rename NETLINK_GENERIC to NET_LINK_GENERIC (which is the right name de-facto)
A> *) Add conditional define for NETLINK_GENERIC to if_mib and set it to 16
A> *) Define another tree in if_mib.c under net.link <http://net.link/>.generic16 with value 16

Let's request exp-run with NETLINK_GENERIC removed or renamed to NET_LINK_GENERIC.
Very likely deprecating this name would go fairly easy.

-- 
Gleb Smirnoff



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZBIlGz%2BrolI6FRmN>