Deleted Added
sdiff udiff text old ( 186119 ) new ( 186215 )
full compact
1/*-
2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 59 unchanged lines hidden (view full) ---

68 * requested.
69 * 2) When such routes lose all their references, it arranges for them
70 * to be deleted in some random collection of circumstances, so that
71 * a large quantity of stale routing data is not kept in kernel memory
72 * indefinitely. See in6_rtqtimo() below for the exact mechanism.
73 */
74
75#include <sys/cdefs.h>
76__FBSDID("$FreeBSD: head/sys/netinet6/in6_rmx.c 186215 2008-12-17 10:03:49Z qingli $");
77
78#include <sys/param.h>
79#include <sys/systm.h>
80#include <sys/kernel.h>
81#include <sys/lock.h>
82#include <sys/sysctl.h>
83#include <sys/queue.h>
84#include <sys/socket.h>

--- 130 unchanged lines hidden (view full) ---

215
216SYSCTL_V_INT(V_NET, vnet_inet6, _net_inet6_ip6, IPV6CTL_RTMINEXPIRE,
217 rtminexpire, CTLFLAG_RW, rtq_minreallyold6 , 0, "");
218
219SYSCTL_V_INT(V_NET, vnet_inet6, _net_inet6_ip6, IPV6CTL_RTMAXCACHE,
220 rtmaxcache, CTLFLAG_RW, rtq_toomany6 , 0, "");
221
222
223
224struct rtqk_arg {
225 struct radix_node_head *rnh;
226 int mode;
227 int updating;
228 int draining;
229 int killed;
230 int found;
231 time_t nextstop;

--- 205 unchanged lines hidden (view full) ---

437 V_rtq_reallyold6 = 60*60; /* one hour is ``really old'' */
438 V_rtq_minreallyold6 = 10; /* never automatically crank down to less */
439 V_rtq_toomany6 = 128; /* 128 cached routes is ``too many'' */
440 V_rtq_timeout6 = RTQ_TIMEOUT;
441
442 rnh = *head;
443 rnh->rnh_addaddr = in6_addroute;
444 rnh->rnh_matchaddr = in6_matroute;
445 callout_init(&V_rtq_timer6, CALLOUT_MPSAFE);
446 in6_rtqtimo(rnh); /* kick off timeout first time */
447 callout_init(&V_rtq_mtutimer, CALLOUT_MPSAFE);
448 in6_mtutimo(rnh); /* kick off timeout first time */
449 return 1;
450}