1/* $FreeBSD: head/sys/netinet6/ip6_input.c 120386 2003-09-23 17:54:04Z sam $ */ |
2/* $KAME: ip6_input.c,v 1.259 2002/01/21 04:58:09 jinmei Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 128 unchanged lines hidden (view full) --- 138extern struct callout in6_tmpaddrtimer_ch; 139 140int ip6_forward_srcrt; /* XXX */ 141int ip6_sourcecheck; /* XXX */ 142int ip6_sourcecheck_interval; /* XXX */ 143 144int ip6_ours_check_algorithm; 145 |
146#ifdef PFIL_HOOKS 147struct pfil_head inet6_pfil_hook; 148#endif |
149 150/* firewall hooks */ 151ip6_fw_chk_t *ip6_fw_chk_ptr; 152ip6_fw_ctl_t *ip6_fw_ctl_ptr; 153int ip6_fw_enable = 1; 154 155struct ip6stat ip6stat; 156 --- 25 unchanged lines hidden (view full) --- 182 panic("ip6_init"); 183 for (i = 0; i < IPPROTO_MAX; i++) 184 ip6_protox[i] = pr - inet6sw; 185 for (pr = (struct ip6protosw *)inet6domain.dom_protosw; 186 pr < (struct ip6protosw *)inet6domain.dom_protoswNPROTOSW; pr++) 187 if (pr->pr_domain->dom_family == PF_INET6 && 188 pr->pr_protocol && pr->pr_protocol != IPPROTO_RAW) 189 ip6_protox[pr->pr_protocol] = pr - inet6sw; |
190#ifdef PFIL_HOOKS 191 inet6_pfil_hook.ph_type = PFIL_TYPE_AF; 192 inet6_pfil_hook.ph_af = AF_INET6; 193 if ((i = pfil_head_register(&inet6_pfil_hook)) != 0) 194 printf("%s: WARNING: unable to register pfil hook, " 195 "error %d\n", __func__, i); 196#endif /* PFIL_HOOKS */ |
197 ip6intrq.ifq_maxlen = ip6qmaxlen; 198 mtx_init(&ip6intrq.ifq_mtx, "ip6_inq", NULL, MTX_DEF); 199 netisr_register(NETISR_IPV6, ip6_input, &ip6intrq); 200 nd6_init(); 201 frag6_init(); 202 /* 203 * in many cases, random() here does NOT return random number 204 * as initialization during bootstrap time occur in fixed order. --- 41 unchanged lines hidden (view full) --- 246 struct mbuf *m; 247{ 248 struct ip6_hdr *ip6; 249 int off = sizeof(struct ip6_hdr), nest; 250 u_int32_t plen; 251 u_int32_t rtalert = ~0; 252 int nxt, ours = 0; 253 struct ifnet *deliverifp = NULL; |
254 255#ifdef IPSEC 256 /* 257 * should the inner packet be considered authentic? 258 * see comment in ah4_input(). 259 */ 260 if (m) { 261 m->m_flags &= ~M_AUTHIPHDR; --- 78 unchanged lines hidden (view full) --- 340 if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { 341 ip6stat.ip6s_badvers++; 342 in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_hdrerr); 343 goto bad; 344 } 345 346#ifdef PFIL_HOOKS 347 /* |
348 * Run through list of hooks for input packets. |
349 */ |
350 if (pfil_run_hooks(&inet6_pfil_hook, &m, m->m_pkthdr.rcvif, PFIL_IN)) 351 return; 352 if (m == NULL) /* consumed by filter */ 353 return; 354 ip6 = mtod(m, struct ip6_hdr *); |
355#endif /* PFIL_HOOKS */ 356 357 ip6stat.ip6s_nxthist[ip6->ip6_nxt]++; 358 359 /* 360 * Check with the firewall... 361 */ 362 if (ip6_fw_enable && ip6_fw_chk_ptr) { --- 1274 unchanged lines hidden --- |