diff options
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_divert.c | 4 | ||||
-rw-r--r-- | sys/netinet/raw_ip.c | 4 | ||||
-rw-r--r-- | sys/netinet/tcp_subr.c | 5 | ||||
-rw-r--r-- | sys/netinet/udp_usrreq.c | 4 |
4 files changed, 9 insertions, 8 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index acee341..0837d2e 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -592,8 +592,8 @@ div_pcblist(SYSCTL_HANDLER_ARGS) */ if (req->oldptr == 0) { n = V_divcbinfo.ipi_count; - req->oldidx = 2 * (sizeof xig) - + (n + n/8) * sizeof(struct xinpcb); + n += imax(n / 8, 10); + req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb); return 0; } diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 0b77b5b..d6b426c 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -993,8 +993,8 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) */ if (req->oldptr == 0) { n = V_ripcbinfo.ipi_count; - req->oldidx = 2 * (sizeof xig) - + (n + n/8) * sizeof(struct xinpcb); + n += imax(n / 8, 10); + req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb); return (0); } diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index da478b3..bfa3e66 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1022,8 +1022,9 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (req->oldptr == NULL) { m = syncache_pcbcount(); n = V_tcbinfo.ipi_count; - req->oldidx = 2 * (sizeof xig) - + ((m + n) + n/8) * sizeof(struct xtcpcb); + n += imax(n / 8, 10); + req->oldidx = 2 * (sizeof xig) + + (m + n) * sizeof(struct xtcpcb); return (0); } diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 4541038..adb11c4 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -707,8 +707,8 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) */ if (req->oldptr == 0) { n = V_udbinfo.ipi_count; - req->oldidx = 2 * (sizeof xig) - + (n + n/8) * sizeof(struct xinpcb); + n += imax(n / 8, 10); + req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb); return (0); } |