Deleted Added
full compact
in_rmx.c (193232) in_rmx.c (193731)
1/*-
2 * Copyright 1994, 1995 Massachusetts Institute of Technology
3 *
4 * Permission to use, copy, modify, and distribute this software and
5 * its documentation for any purpose and without fee is hereby
6 * granted, provided that both the above copyright notice and this
7 * permission notice appear in all copies, that both the above
8 * copyright notice and this permission notice appear in all

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

36 * requested.
37 * 2) When such routes lose all their references, it arranges for them
38 * to be deleted in some random collection of circumstances, so that
39 * a large quantity of stale routing data is not kept in kernel memory
40 * indefinitely. See in_rtqtimo() below for the exact mechanism.
41 */
42
43#include <sys/cdefs.h>
1/*-
2 * Copyright 1994, 1995 Massachusetts Institute of Technology
3 *
4 * Permission to use, copy, modify, and distribute this software and
5 * its documentation for any purpose and without fee is hereby
6 * granted, provided that both the above copyright notice and this
7 * permission notice appear in all copies, that both the above
8 * copyright notice and this permission notice appear in all

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

36 * requested.
37 * 2) When such routes lose all their references, it arranges for them
38 * to be deleted in some random collection of circumstances, so that
39 * a large quantity of stale routing data is not kept in kernel memory
40 * indefinitely. See in_rtqtimo() below for the exact mechanism.
41 */
42
43#include <sys/cdefs.h>
44__FBSDID("$FreeBSD: head/sys/netinet/in_rmx.c 193232 2009-06-01 15:49:42Z bz $");
44__FBSDID("$FreeBSD: head/sys/netinet/in_rmx.c 193731 2009-06-08 17:15:40Z zec $");
45
46#include "opt_route.h"
47
48#include <sys/param.h>
49#include <sys/systm.h>
50#include <sys/kernel.h>
51#include <sys/sysctl.h>
52#include <sys/socket.h>

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

60#include <net/vnet.h>
61
62#include <netinet/in.h>
63#include <netinet/in_var.h>
64#include <netinet/ip_var.h>
65#include <netinet/vinet.h>
66
67extern int in_inithead(void **head, int off);
45
46#include "opt_route.h"
47
48#include <sys/param.h>
49#include <sys/systm.h>
50#include <sys/kernel.h>
51#include <sys/sysctl.h>
52#include <sys/socket.h>

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

60#include <net/vnet.h>
61
62#include <netinet/in.h>
63#include <netinet/in_var.h>
64#include <netinet/ip_var.h>
65#include <netinet/vinet.h>
66
67extern int in_inithead(void **head, int off);
68#ifdef VIMAGE
69extern int in_detachhead(void **head, int off);
70#endif
68
69#define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */
70
71/*
72 * Do what we need to do when inserting a route.
73 */
74static struct radix_node *
75in_addroute(void *v_arg, void *n_arg, struct radix_node_head *head,

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

377 if (_in_rt_was_here == 0 ) {
378 callout_init(&V_rtq_timer, CALLOUT_MPSAFE);
379 callout_reset(&V_rtq_timer, 1, in_rtqtimo, curvnet);
380 _in_rt_was_here = 1;
381 }
382 return 1;
383}
384
71
72#define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */
73
74/*
75 * Do what we need to do when inserting a route.
76 */
77static struct radix_node *
78in_addroute(void *v_arg, void *n_arg, struct radix_node_head *head,

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

380 if (_in_rt_was_here == 0 ) {
381 callout_init(&V_rtq_timer, CALLOUT_MPSAFE);
382 callout_reset(&V_rtq_timer, 1, in_rtqtimo, curvnet);
383 _in_rt_was_here = 1;
384 }
385 return 1;
386}
387
388#ifdef VIMAGE
389int
390in_detachhead(void **head, int off)
391{
392 INIT_VNET_INET(curvnet);
393
394 callout_drain(&V_rtq_timer);
395 return (1);
396}
397#endif
398
385/*
386 * This zaps old routes when the interface goes down or interface
387 * address is deleted. In the latter case, it deletes static routes
388 * that point to this address. If we don't do this, we may end up
389 * using the old address in the future. The ones we always want to
390 * get rid of are things like ARP entries, since the user might down
391 * the interface, walk over to a completely different network, and
392 * plug back in.

--- 105 unchanged lines hidden ---
399/*
400 * This zaps old routes when the interface goes down or interface
401 * address is deleted. In the latter case, it deletes static routes
402 * that point to this address. If we don't do this, we may end up
403 * using the old address in the future. The ones we always want to
404 * get rid of are things like ARP entries, since the user might down
405 * the interface, walk over to a completely different network, and
406 * plug back in.

--- 105 unchanged lines hidden ---