summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_syncache.c
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-19 23:48:27 +0000
committerpfg <pfg@FreeBSD.org>2016-04-19 23:48:27 +0000
commita7d40a88c91d105dcfe2f235bc84a522bfea3de2 (patch)
treede102c840aded1a3b5511745802f9d6ef74aeb6f /sys/netinet/tcp_syncache.c
parent99e9a53c8161ee4ae550ad18b73edd303a3724f4 (diff)
downloadFreeBSD-src-a7d40a88c91d105dcfe2f235bc84a522bfea3de2.zip
FreeBSD-src-a7d40a88c91d105dcfe2f235bc84a522bfea3de2.tar.gz
kernel: use our nitems() macro when it is available through param.h.
No functional change, only trivial cases are done in this sweep, Discussed in: freebsd-current
Diffstat (limited to 'sys/netinet/tcp_syncache.c')
-rw-r--r--sys/netinet/tcp_syncache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index 1cf27e1..91e4c59 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -1896,7 +1896,7 @@ syncookie_generate(struct syncache_head *sch, struct syncache *sc)
/* Map our computed MSS into the 3-bit index. */
mss = min(tcp_mssopt(&sc->sc_inc), max(sc->sc_peer_mss, V_tcp_minmss));
- for (i = sizeof(tcp_sc_msstab) / sizeof(*tcp_sc_msstab) - 1;
+ for (i = nitems(tcp_sc_msstab) - 1;
tcp_sc_msstab[i] > mss && i > 0;
i--)
;
@@ -1908,7 +1908,7 @@ syncookie_generate(struct syncache_head *sch, struct syncache *sc)
*/
if (sc->sc_flags & SCF_WINSCALE) {
wscale = sc->sc_requested_s_scale;
- for (i = sizeof(tcp_sc_wstab) / sizeof(*tcp_sc_wstab) - 1;
+ for (i = nitems(tcp_sc_wstab) - 1;
tcp_sc_wstab[i] > wscale && i > 0;
i--)
;
OpenPOWER on IntegriCloud