Deleted Added
full compact
icmp6.c (201688) icmp6.c (207369)
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

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

56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE.
59 *
60 * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
61 */
62
63#include <sys/cdefs.h>
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

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

56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE.
59 *
60 * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
61 */
62
63#include <sys/cdefs.h>
64__FBSDID("$FreeBSD: head/sys/netinet6/icmp6.c 201688 2010-01-06 23:05:00Z bz $");
64__FBSDID("$FreeBSD: head/sys/netinet6/icmp6.c 207369 2010-04-29 11:52:42Z bz $");
65
66#include "opt_inet.h"
67#include "opt_inet6.h"
68#include "opt_ipsec.h"
69
70#include <sys/param.h>
71#include <sys/domain.h>
72#include <sys/jail.h>

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

108
109#ifdef IPSEC
110#include <netipsec/ipsec.h>
111#include <netipsec/key.h>
112#endif
113
114extern struct domain inet6domain;
115
65
66#include "opt_inet.h"
67#include "opt_inet6.h"
68#include "opt_ipsec.h"
69
70#include <sys/param.h>
71#include <sys/domain.h>
72#include <sys/jail.h>

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

108
109#ifdef IPSEC
110#include <netipsec/ipsec.h>
111#include <netipsec/key.h>
112#endif
113
114extern struct domain inet6domain;
115
116VNET_DEFINE(struct icmp6stat, icmp6stat);
117
116VNET_DECLARE(struct inpcbinfo, ripcbinfo);
117VNET_DECLARE(struct inpcbhead, ripcb);
118VNET_DECLARE(int, icmp6errppslim);
118VNET_DECLARE(struct inpcbinfo, ripcbinfo);
119VNET_DECLARE(struct inpcbhead, ripcb);
120VNET_DECLARE(int, icmp6errppslim);
121static VNET_DEFINE(int, icmp6errpps_count) = 0;
122static VNET_DEFINE(struct timeval, icmp6errppslim_last);
119VNET_DECLARE(int, icmp6_nodeinfo);
120
121#define V_ripcbinfo VNET(ripcbinfo)
122#define V_ripcb VNET(ripcb)
123#define V_icmp6errppslim VNET(icmp6errppslim)
123VNET_DECLARE(int, icmp6_nodeinfo);
124
125#define V_ripcbinfo VNET(ripcbinfo)
126#define V_ripcb VNET(ripcb)
127#define V_icmp6errppslim VNET(icmp6errppslim)
128#define V_icmp6errpps_count VNET(icmp6errpps_count)
129#define V_icmp6errppslim_last VNET(icmp6errppslim_last)
124#define V_icmp6_nodeinfo VNET(icmp6_nodeinfo)
125
130#define V_icmp6_nodeinfo VNET(icmp6_nodeinfo)
131
126VNET_DEFINE(struct icmp6stat, icmp6stat);
127static VNET_DEFINE(int, icmp6errpps_count);
128static VNET_DEFINE(struct timeval, icmp6errppslim_last);
129
130#define V_icmp6errpps_count VNET(icmp6errpps_count)
131#define V_icmp6errppslim_last VNET(icmp6errppslim_last)
132
133static void icmp6_errcount(struct icmp6errstat *, int, int);
134static int icmp6_rip6_input(struct mbuf **, int);
135static int icmp6_ratelimit(const struct in6_addr *, const int, const int);
136static const char *icmp6_redirect_diag __P((struct in6_addr *,
137 struct in6_addr *, struct in6_addr *));
138static struct mbuf *ni6_input(struct mbuf *, int);
139static struct mbuf *ni6_nametodns(const char *, int, int);
140static int ni6_dnsmatch(const char *, int, const char *, int);
141static int ni6_addrs __P((struct icmp6_nodeinfo *, struct mbuf *,
142 struct ifnet **, struct in6_addr *));
143static int ni6_store_addrs __P((struct icmp6_nodeinfo *, struct icmp6_nodeinfo *,
144 struct ifnet *, int));
145static int icmp6_notify_error(struct mbuf **, int, int, int);
146
132static void icmp6_errcount(struct icmp6errstat *, int, int);
133static int icmp6_rip6_input(struct mbuf **, int);
134static int icmp6_ratelimit(const struct in6_addr *, const int, const int);
135static const char *icmp6_redirect_diag __P((struct in6_addr *,
136 struct in6_addr *, struct in6_addr *));
137static struct mbuf *ni6_input(struct mbuf *, int);
138static struct mbuf *ni6_nametodns(const char *, int, int);
139static int ni6_dnsmatch(const char *, int, const char *, int);
140static int ni6_addrs __P((struct icmp6_nodeinfo *, struct mbuf *,
141 struct ifnet **, struct in6_addr *));
142static int ni6_store_addrs __P((struct icmp6_nodeinfo *, struct icmp6_nodeinfo *,
143 struct ifnet *, int));
144static int icmp6_notify_error(struct mbuf **, int, int, int);
145
147
148void
149icmp6_init(void)
150{
151
152 V_icmp6errpps_count = 0;
153}
154
155/*
156 * Kernel module interface for updating icmp6stat. The argument is an index
157 * into icmp6stat treated as an array of u_quad_t. While this encodes the
158 * general layout of icmp6stat into the caller, it doesn't encode its
159 * location, so that future changes to add, for example, per-CPU stats
160 * support won't cause binary compatibility problems for kernel modules.
161 */
162void

--- 2702 unchanged lines hidden ---
146/*
147 * Kernel module interface for updating icmp6stat. The argument is an index
148 * into icmp6stat treated as an array of u_quad_t. While this encodes the
149 * general layout of icmp6stat into the caller, it doesn't encode its
150 * location, so that future changes to add, for example, per-CPU stats
151 * support won't cause binary compatibility problems for kernel modules.
152 */
153void

--- 2702 unchanged lines hidden ---