version 1.66.4.5, 2001/05/09 19:37:41 |
version 1.68, 2000/07/06 12:51:40 |
|
|
#include <sys/proc.h> |
#include <sys/proc.h> |
#include <sys/domain.h> |
#include <sys/domain.h> |
|
|
#include <vm/vm.h> |
#include <uvm/uvm_extern.h> |
#include <sys/sysctl.h> |
#include <sys/sysctl.h> |
|
|
#include <net/if.h> |
#include <net/if.h> |
|
|
#endif |
#endif |
#endif |
#endif |
|
|
#include "faith.h" |
|
#if defined(NFAITH) && NFAITH > 0 |
|
#include <net/if_faith.h> |
|
#endif |
|
|
|
#include <machine/stdarg.h> |
#include <machine/stdarg.h> |
|
|
#ifdef IPSEC |
#ifdef IPSEC |
#include <netinet6/ipsec.h> |
#include <netinet6/ipsec.h> |
#include <netkey/key.h> |
#include <netkey/key.h> |
#include <netkey/key_debug.h> |
|
#endif /*IPSEC*/ |
#endif /*IPSEC*/ |
|
|
#ifdef IPKDB |
#ifdef IPKDB |
Line 237 udp_input(m, va_alist) |
|
Line 231 udp_input(m, va_alist) |
|
*/ |
*/ |
len = ntohs((u_int16_t)uh->uh_ulen); |
len = ntohs((u_int16_t)uh->uh_ulen); |
if (ip->ip_len != iphlen + len) { |
if (ip->ip_len != iphlen + len) { |
if (ip->ip_len < iphlen + len || len < sizeof(struct udphdr)) { |
if (ip->ip_len < iphlen + len) { |
udpstat.udps_badlen++; |
udpstat.udps_badlen++; |
goto bad; |
goto bad; |
} |
} |
Line 330 udp6_input(mp, offp, proto) |
|
Line 324 udp6_input(mp, offp, proto) |
|
struct udphdr *uh; |
struct udphdr *uh; |
u_int32_t plen, ulen; |
u_int32_t plen, ulen; |
|
|
#ifndef PULLDOWN_TEST |
|
IP6_EXTHDR_CHECK(m, off, sizeof(struct udphdr), IPPROTO_DONE); |
|
#endif |
|
ip6 = mtod(m, struct ip6_hdr *); |
|
|
|
#if defined(NFAITH) && 0 < NFAITH |
#if defined(NFAITH) && 0 < NFAITH |
if (faithprefix(&ip6->ip6_dst)) { |
if (m->m_pkthdr.rcvif) { |
/* send icmp6 host unreach? */ |
if (m->m_pkthdr.rcvif->if_type == IFT_FAITH) { |
m_freem(m); |
/* send icmp6 host unreach? */ |
return IPPROTO_DONE; |
m_freem(m); |
|
return IPPROTO_DONE; |
|
} |
} |
} |
#endif |
#endif |
|
|
udp6stat.udp6s_ipackets++; |
udp6stat.udp6s_ipackets++; |
|
|
|
#ifndef PULLDOWN_TEST |
|
IP6_EXTHDR_CHECK(m, off, sizeof(struct udphdr), IPPROTO_DONE); |
|
#endif |
|
|
|
ip6 = mtod(m, struct ip6_hdr *); |
/* check for jumbogram is done in ip6_input. we can trust pkthdr.len */ |
/* check for jumbogram is done in ip6_input. we can trust pkthdr.len */ |
plen = m->m_pkthdr.len - off; |
plen = m->m_pkthdr.len - off; |
#ifndef PULLDOWN_TEST |
#ifndef PULLDOWN_TEST |
Line 557 udp4_realinput(src, dst, m, off) |
|
Line 553 udp4_realinput(src, dst, m, off) |
|
dst4 = &dst->sin_addr; |
dst4 = &dst->sin_addr; |
dport = &dst->sin_port; |
dport = &dst->sin_port; |
|
|
if (IN_MULTICAST(dst4->s_addr) || |
if (IN_MULTICAST(src4->s_addr) || |
in_broadcast(*dst4, m->m_pkthdr.rcvif)) { |
in_broadcast(*dst4, m->m_pkthdr.rcvif)) { |
struct inpcb *last; |
struct inpcb *last; |
/* |
/* |
Line 706 udp6_realinput(af, src, dst, m, off) |
|
Line 702 udp6_realinput(af, src, dst, m, off) |
|
u_int16_t *sport, *dport; |
u_int16_t *sport, *dport; |
int rcvcnt; |
int rcvcnt; |
struct in6_addr *src6, *dst6; |
struct in6_addr *src6, *dst6; |
struct in_addr *dst4; |
struct in_addr *src4; |
struct in6pcb *in6p; |
struct in6pcb *in6p; |
|
|
rcvcnt = 0; |
rcvcnt = 0; |
Line 721 udp6_realinput(af, src, dst, m, off) |
|
Line 717 udp6_realinput(af, src, dst, m, off) |
|
sport = &src->sin6_port; |
sport = &src->sin6_port; |
dst6 = &dst->sin6_addr; |
dst6 = &dst->sin6_addr; |
dport = &dst->sin6_port; |
dport = &dst->sin6_port; |
dst4 = (struct in_addr *)&dst->sin6_addr.s6_addr32[12]; |
src4 = (struct in_addr *)&src->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(src4->s_addr))) { |
struct in6pcb *last; |
struct in6pcb *last; |
/* |
/* |
* Deliver a multicast or broadcast datagram to *all* sockets |
* Deliver a multicast or broadcast datagram to *all* sockets |
Line 928 udp_input(m, va_alist) |
|
Line 924 udp_input(m, va_alist) |
|
*/ |
*/ |
len = ntohs((u_int16_t)uh->uh_ulen); |
len = ntohs((u_int16_t)uh->uh_ulen); |
if (ip->ip_len != iphlen + len) { |
if (ip->ip_len != iphlen + len) { |
if (ip->ip_len < iphlen + len || len < sizeof(struct udphdr)) { |
if (ip->ip_len < iphlen + len) { |
udpstat.udps_badlen++; |
udpstat.udps_badlen++; |
goto bad; |
goto bad; |
} |
} |
Line 1257 udp_output(m, va_alist) |
|
Line 1253 udp_output(m, va_alist) |
|
udpstat.udps_opackets++; |
udpstat.udps_opackets++; |
|
|
#ifdef IPSEC |
#ifdef IPSEC |
if (ipsec_setsocket(m, inp->inp_socket) != 0) { |
ipsec_setsocket(m, inp->inp_socket); |
error = ENOBUFS; |
|
goto release; |
|
} |
|
#endif /*IPSEC*/ |
#endif /*IPSEC*/ |
|
|
return (ip_output(m, inp->inp_options, &inp->inp_route, |
return (ip_output(m, inp->inp_options, &inp->inp_route, |