Module Name:    src
Committed By:   ozaki-r
Date:           Thu Mar 30 04:37:58 UTC 2017

Modified Files:
        src/doc: TODO.smpnet

Log Message:
Write about lingering obsolete variables due to kvm(3)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/doc/TODO.smpnet

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/TODO.smpnet
diff -u src/doc/TODO.smpnet:1.9 src/doc/TODO.smpnet:1.10
--- src/doc/TODO.smpnet:1.9	Sat Mar 11 07:23:13 2017
+++ src/doc/TODO.smpnet	Thu Mar 30 04:37:58 2017
@@ -1,4 +1,4 @@
-$NetBSD: TODO.smpnet,v 1.9 2017/03/11 07:23:13 msaitoh Exp $
+$NetBSD: TODO.smpnet,v 1.10 2017/03/30 04:37:58 ozaki-r Exp $
 
 MP-safe components
 ==================
@@ -104,3 +104,40 @@ actual devices, no time (or interest/lov
 provide a deferred bpf_mtap mechanism that forcibly runs bpf_mtap in softint
 context.  It's a workaround and once the functions run in softint, we should use
 the original bpf_mtap again.
+
+Lingering obsolete variables
+-----------------------------
+
+Some obsolete global variables and member variables of structures remain to
+avoid breaking old userland programs which directly access such variables via
+kvm(3).
+
+The following programs still use kvm(3) to get some information related to
+the network stack.
+
+ - netstat(1)
+ - vmstat(1)
+ - fstat(1)
+
+netstat(1) accesses ifnet_list, the head of a list of interface objects
+(struct ifnet), and traverses each object through ifnet#if_list member variable.
+ifnet_list and ifnet#if_list is obsoleted by ifnet_pslist and
+ifnet#if_pslist_entry respectively. netstat also accesses the IP address list
+of an interface throught ifnet#if_addrlist. struct ifaddr, struct in_ifaddr
+and struct in6_ifaddr are accessed and the following obsolete member variables
+are stuck: ifaddr#ifa_list, in_ifaddr#ia_hash, in_ifaddr#ia_list,
+in6_ifaddr#ia_next and in6_ifaddr#_ia6_multiaddrs. Note that netstat already
+implements alternative methods to fetch the above information via sysctl(3).
+
+vmstat(1) shows statistics of hash tables created by hashinit(9) in the kernel.
+The statistic information is retrieved via kvm(3). The global variables
+in_ifaddrhash and in_ifaddrhashtbl, which are for a hash table of IPv4
+addresses and obsoleted by in_ifaddrhash_pslist and in_ifaddrhashtbl_pslist,
+are kept for this purpose. We should provide a means to fetch statistics of
+hash tables via sysctl(3).
+
+fstat(1) shows information of bpf instances. Each bpf instance (struct bpf) is
+obtained via kvm(3). bpf_d#_bd_next, bpf_d#_bd_filter and bpf_d#_bd_list
+member variables are obsolete but remain. ifnet#if_xname is also accessed
+via struct bpf_if and obsolete ifnet#if_list is required to remain to not change
+the offset of ifnet#if_xname.

Reply via email to