inpcb: Use netisr_ncpus for listing inpcbs.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 8 Apr 2017 06:38:06 +0000 (14:38 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 8 Apr 2017 06:38:06 +0000 (14:38 +0800)
sys/netinet/in_pcb.c
sys/netinet/in_pcb.h
sys/netinet/ip_divert.c
sys/netinet/raw_ip.c
sys/netinet/udp_usrreq.c

index 7b5833c..263ce96 100644 (file)
@@ -2199,7 +2199,7 @@ prison_xinpcb(struct thread *td, struct inpcb *inp)
 }
 
 int
-in_pcblist_global(SYSCTL_HANDLER_ARGS)
+in_pcblist_range(SYSCTL_HANDLER_ARGS)
 {
        struct inpcbinfo *pcbinfo_arr = arg1;
        int pcbinfo_arrlen = arg2;
@@ -2288,9 +2288,10 @@ in_pcblist_global(SYSCTL_HANDLER_ARGS)
 }
 
 int
-in_pcblist_global_ncpus2(SYSCTL_HANDLER_ARGS)
+in_pcblist_ncpus(SYSCTL_HANDLER_ARGS)
 {
-       return in_pcblist_global(oidp, arg1, ncpus2, req);
+
+       return (in_pcblist_range(oidp, arg1, netisr_ncpus, req));
 }
 
 void
index fa198b0..a0b0e29 100644 (file)
@@ -543,8 +543,8 @@ struct inpcb *
 void   in_pcbglobalinit(void);
 void   in_pcbresetroute(struct inpcb *);
 
-int    in_pcblist_global(SYSCTL_HANDLER_ARGS);
-int    in_pcblist_global_ncpus2(SYSCTL_HANDLER_ARGS);
+int    in_pcblist_range(SYSCTL_HANDLER_ARGS);
+int    in_pcblist_ncpus(SYSCTL_HANDLER_ARGS);
 
 struct inpcb *
        in_pcbmarker(int cpuid);
index 85fa421..ce996ca 100644 (file)
@@ -514,7 +514,7 @@ div_send(netmsg_t msg)
 
 SYSCTL_DECL(_net_inet_divert);
 SYSCTL_PROC(_net_inet_divert, OID_AUTO, pcblist, CTLFLAG_RD, &divcbinfo, 1,
-           in_pcblist_global, "S,xinpcb", "List of active divert sockets");
+           in_pcblist_range, "S,xinpcb", "List of active divert sockets");
 
 struct pr_usrreqs div_usrreqs = {
        .pru_abort = div_abort,
index cbf0bb9..de2c972 100644 (file)
@@ -760,7 +760,7 @@ rip_send(netmsg_t msg)
 }
 
 SYSCTL_PROC(_net_inet_raw, OID_AUTO/*XXX*/, pcblist, CTLFLAG_RD, &ripcbinfo, 1,
-           in_pcblist_global, "S,xinpcb", "List of active raw IP sockets");
+           in_pcblist_range, "S,xinpcb", "List of active raw IP sockets");
 
 struct pr_usrreqs rip_usrreqs = {
        .pru_abort = rip_abort,
index a99c3f4..b50c7c7 100644 (file)
@@ -847,7 +847,7 @@ done:
 }
 
 SYSCTL_PROC(_net_inet_udp, UDPCTL_PCBLIST, pcblist, CTLFLAG_RD, udbinfo, 0,
-           in_pcblist_global_ncpus2, "S,xinpcb", "List of active UDP sockets");
+           in_pcblist_ncpus, "S,xinpcb", "List of active UDP sockets");
 
 static int
 udp_getcred(SYSCTL_HANDLER_ARGS)