Lines Matching +full:close +full:- +full:range
1 /*-
37 * 1. Get system wide number of FIBs from sysctl and convert to index (-= 1).
40 * 3. Do a sequence of -2, -1, 0, .. n, n+1, n+2 SO_SETFIB sockopt calls,
42 * 4. Try 3 random numbers. Calculate result based on valid range.
82 * Number of FIBs as read from net.fibs sysctl - 1. Initialize to clear out of
83 * bounds value to not accidentally run on a limited range.
85 static int rt_numfibs = -42;
93 * Handle result given on error and valid range and errno.
102 if (error == -1 && (i < 0 || i > rt_numfibs)) in so_setfib()
105 else if (error != -1 && (i < 0 || i > rt_numfibs)) in so_setfib()
142 if (s == -1) { in t()
149 /* Test FIBs -2, -1, 0, .. n, n + 1, n + 2. */ in t()
150 for (i = -2; i <= (rt_numfibs + 2); i++) in t()
157 /* Close socket. */ in t()
158 close(s); in t()
181 if (sysctlbyname("net.fibs", &rt_numfibs, &s, NULL, 0) == -1) in main()
185 (nitems(t_dom) - 1) * nitems(t_type) * (2 + rt_numfibs + 2 + 3)); in main()
188 rt_numfibs -= 1; in main()