[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Static content in /proc/net/dev.


Mats Erik Andersson <mats.andersson@gisladisker.se> writes:
> as I learned in another message [1] the fact that
> "/proc/net/dev" lists wrong interface names (eth0 and
> similar) might be easily mended. However, much worse
> is the fact that "/proc/net/dev" seems never to be
> updated, thus rendering many networking tools useless

afaik /proc/net/dev is just a compatibility wrapper originally created
for running non-free linux binaries of Netscape on freebsd ;-)

The current implementation is indeed very simple:

 * Filler function for proc/net/dev
static int
        char ifname[16]; /* XXX LINUX_IFNAMSIZ */
        struct ifnet *ifp;

        sbuf_printf(sb, "%6s|%58s|%s\n%6s|%58s|%58s\n",
            "Inter-", "   Receive", "  Transmit", " face",
            "bytes    packets errs drop fifo frame compressed",
            "bytes    packets errs drop fifo frame compressed");

        TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
                linux_ifname(ifp, ifname, sizeof ifname);
                        sbuf_printf(sb, "%6.6s:", ifname);
                sbuf_printf(sb, "%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu ",
                    0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL);
                sbuf_printf(sb, "%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n",
                    0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL);

        return (0);

I think you need to discuss with upstream whether they want to extend
this compatibility wrapper or rather see us port the applications to
the native interface. Would


perhaps be the proper forum for this?

best regards,
Timo Lindfors

Reply to: