version 1.85.2.1, 2001/11/12 21:19:29 |
version 1.86, 2001/10/24 06:04:08 |
|
|
#include <sys/systm.h> |
#include <sys/systm.h> |
#include <sys/proc.h> |
#include <sys/proc.h> |
#include <sys/domain.h> |
#include <sys/domain.h> |
|
|
|
#include <uvm/uvm_extern.h> |
#include <sys/sysctl.h> |
#include <sys/sysctl.h> |
|
|
#include <net/if.h> |
#include <net/if.h> |
Line 145 static int udp4_realinput __P((struct so |
|
Line 147 static int udp4_realinput __P((struct so |
|
#ifdef INET6 |
#ifdef INET6 |
static void udp6_sendup __P((struct mbuf *, int, struct sockaddr *, |
static void udp6_sendup __P((struct mbuf *, int, struct sockaddr *, |
struct socket *)); |
struct socket *)); |
|
static int in6_mcmatch __P((struct in6pcb *, struct in6_addr *, |
|
struct ifnet *)); |
static int udp6_realinput __P((int, struct sockaddr_in6 *, |
static int udp6_realinput __P((int, struct sockaddr_in6 *, |
struct sockaddr_in6 *, struct mbuf *, int)); |
struct sockaddr_in6 *, struct mbuf *, int)); |
#endif |
#endif |
Line 633 udp4_realinput(src, dst, m, off) |
|
Line 637 udp4_realinput(src, dst, m, off) |
|
/* |
/* |
* Locate pcb(s) for datagram. |
* Locate pcb(s) for datagram. |
*/ |
*/ |
CIRCLEQ_FOREACH(inp, &udbtable.inpt_queue, inp_queue) { |
for (inp = udbtable.inpt_queue.cqh_first; |
|
inp != (struct inpcb *)&udbtable.inpt_queue; |
|
inp = inp->inp_queue.cqe_next) { |
if (inp->inp_lport != *dport) |
if (inp->inp_lport != *dport) |
continue; |
continue; |
if (!in_nullhost(inp->inp_laddr)) { |
if (!in_nullhost(inp->inp_laddr)) { |
|
|
|
|
#ifdef INET6 |
#ifdef INET6 |
static int |
static int |
|
in6_mcmatch(in6p, ia6, ifp) |
|
struct in6pcb *in6p; |
|
struct in6_addr *ia6; |
|
struct ifnet *ifp; |
|
{ |
|
struct ip6_moptions *im6o = in6p->in6p_moptions; |
|
struct in6_multi_mship *imm; |
|
|
|
if (im6o == NULL) |
|
return 0; |
|
|
|
for (imm = im6o->im6o_memberships.lh_first; imm != NULL; |
|
imm = imm->i6mm_chain.le_next) { |
|
if ((ifp == NULL || |
|
imm->i6mm_maddr->in6m_ifp == ifp) && |
|
IN6_ARE_ADDR_EQUAL(&imm->i6mm_maddr->in6m_addr, |
|
ia6)) |
|
return 1; |
|
} |
|
return 0; |
|
} |
|
|
|
static int |
udp6_realinput(af, src, dst, m, off) |
udp6_realinput(af, src, dst, m, off) |
int af; /* af on packet */ |
int af; /* af on packet */ |
struct sockaddr_in6 *src; |
struct sockaddr_in6 *src; |
Line 711 udp6_realinput(af, src, dst, m, off) |
|
Line 740 udp6_realinput(af, src, dst, m, off) |
|
sport = src->sin6_port; |
sport = src->sin6_port; |
in6_embedscope(&dst6, dst, NULL, NULL); |
in6_embedscope(&dst6, dst, NULL, NULL); |
dport = dst->sin6_port; |
dport = dst->sin6_port; |
dst4 = (struct in_addr *)&dst->sin6_addr.s6_addr[12]; |
dst4 = (struct in_addr *)&dst->sin6_addr.s6_addr32[12]; |
|
|
if (IN6_IS_ADDR_MULTICAST(&dst6) || |
if (IN6_IS_ADDR_MULTICAST(&dst6) || |
(af == AF_INET && IN_MULTICAST(dst4->s_addr))) { |
(af == AF_INET && IN_MULTICAST(dst4->s_addr))) { |
Line 744 udp6_realinput(af, src, dst, m, off) |
|
Line 773 udp6_realinput(af, src, dst, m, off) |
|
if (in6p->in6p_lport != dport) |
if (in6p->in6p_lport != dport) |
continue; |
continue; |
if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_laddr)) { |
if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_laddr)) { |
if (!IN6_ARE_ADDR_EQUAL(&in6p->in6p_laddr, &dst6)) |
if (!IN6_ARE_ADDR_EQUAL(&in6p->in6p_laddr, &dst6) && |
|
!in6_mcmatch(in6p, &dst6, m->m_pkthdr.rcvif)) |
continue; |
continue; |
} |
} |
else { |
else { |