1/* 2 * Copyright (c) 1982, 1986, 1991, 1993, 1995 3 * The Regents of the University of California. 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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)in_pcb.c 8.4 (Berkeley) 5/24/95 |
34 * $FreeBSD: head/sys/netinet/in_pcb.c 83934 2001-09-25 18:40:52Z brooks $ |
35 */ 36 37#include "opt_ipsec.h" 38#include "opt_inet6.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/malloc.h> --- 19 unchanged lines hidden (view full) --- 62#include <netinet/in_pcb.h> 63#include <netinet/in_var.h> 64#include <netinet/ip_var.h> 65#ifdef INET6 66#include <netinet/ip6.h> 67#include <netinet6/ip6_var.h> 68#endif /* INET6 */ 69 |
70#ifdef IPSEC 71#include <netinet6/ipsec.h> 72#include <netkey/key.h> 73#endif /* IPSEC */ 74 75struct in_addr zeroin_addr; 76 77/* --- 834 unchanged lines hidden (view full) --- 912 head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbinfo->hashmask)]; 913 LIST_FOREACH(inp, head, inp_hash) { 914#ifdef INET6 915 if ((inp->inp_vflag & INP_IPV4) == 0) 916 continue; 917#endif 918 if (inp->inp_faddr.s_addr == INADDR_ANY && 919 inp->inp_lport == lport) { |
920 if (ifp && ifp->if_type == IFT_FAITH && 921 (inp->inp_flags & INP_FAITH) == 0) 922 continue; |
923 if (inp->inp_laddr.s_addr == laddr.s_addr) 924 return (inp); 925 else if (inp->inp_laddr.s_addr == INADDR_ANY) { 926#if defined(INET6) 927 if (INP_CHECK_SOCKAF(inp->inp_socket, 928 AF_INET6)) 929 local_wild_mapped = inp; 930 else --- 127 unchanged lines hidden --- |