version 1.52.8.1, 1999/12/27 18:36:21 |
version 1.57, 2000/01/31 10:39:26 |
|
|
in_pcbinit(&udbtable, udbhashsize, udbhashsize); |
in_pcbinit(&udbtable, udbhashsize, udbhashsize); |
} |
} |
|
|
|
#ifndef UDP6 |
void |
void |
#if __STDC__ |
#if __STDC__ |
udp_input(struct mbuf *m, ...) |
udp_input(struct mbuf *m, ...) |
Line 218 udp_input(m, va_alist) |
|
Line 219 udp_input(m, va_alist) |
|
} |
} |
#endif |
#endif |
|
|
|
/* destination port of 0 is illegal, based on RFC768. */ |
|
if (uh->uh_dport == 0) |
|
goto bad; |
|
|
/* |
/* |
* Make mbuf data length reflect UDP length. |
* Make mbuf data length reflect UDP length. |
* If not enough data to reflect UDP length, drop. |
* If not enough data to reflect UDP length, drop. |
Line 375 udp6_input(mp, offp, proto) |
|
Line 380 udp6_input(mp, offp, proto) |
|
goto bad; |
goto bad; |
} |
} |
|
|
|
/* destination port of 0 is illegal, based on RFC768. */ |
|
if (uh->uh_dport == 0) |
|
goto bad; |
|
|
|
/* Be proactive about malicious use of IPv4 mapped address */ |
|
if (IN6_IS_ADDR_V4MAPPED(&ip6->ip6_src) || |
|
IN6_IS_ADDR_V4MAPPED(&ip6->ip6_dst)) { |
|
/* XXX stat */ |
|
goto bad; |
|
} |
|
|
/* |
/* |
* Checksum extended UDP header and data. |
* Checksum extended UDP header and data. |
*/ |
*/ |
Line 758 udp6_realinput(af, src, dst, m, off) |
|
Line 774 udp6_realinput(af, src, dst, m, off) |
|
&& !in6_mcmatch(in6p, dst6, m->m_pkthdr.rcvif)) |
&& !in6_mcmatch(in6p, dst6, m->m_pkthdr.rcvif)) |
continue; |
continue; |
} |
} |
|
#ifndef INET6_BINDV6ONLY |
|
else { |
|
if (IN6_IS_ADDR_V4MAPPED(dst6) |
|
&& (in6p->in6p_flags & IN6P_BINDV6ONLY)) |
|
continue; |
|
} |
|
#endif |
if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr)) { |
if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr)) { |
if (!IN6_ARE_ADDR_EQUAL(&in6p->in6p_faddr, src6) |
if (!IN6_ARE_ADDR_EQUAL(&in6p->in6p_faddr, src6) |
|| in6p->in6p_fport != *sport) |
|| in6p->in6p_fport != *sport) |
continue; |
continue; |
} |
} |
|
#ifndef INET6_BINDV6ONLY |
|
else { |
|
if (IN6_IS_ADDR_V4MAPPED(src6) |
|
&& (in6p->in6p_flags & IN6P_BINDV6ONLY)) |
|
continue; |
|
} |
|
#endif |
|
|
last = in6p; |
last = in6p; |
udp6_sendup(m, off, (struct sockaddr *)src, |
udp6_sendup(m, off, (struct sockaddr *)src, |
|
|
} |
} |
#endif |
#endif |
|
|
#if 0 |
#else /*UDP6*/ |
|
|
void |
void |
#if __STDC__ |
#if __STDC__ |
udp_input(struct mbuf *m, ...) |
udp_input(struct mbuf *m, ...) |
Line 905 udp_input(m, va_alist) |
|
Line 936 udp_input(m, va_alist) |
|
} |
} |
uh = (struct udphdr *)((caddr_t)ip + iphlen); |
uh = (struct udphdr *)((caddr_t)ip + iphlen); |
|
|
|
/* destination port of 0 is illegal, based on RFC768. */ |
|
if (uh->uh_dport == 0) |
|
goto bad; |
|
|
/* |
/* |
* Make mbuf data length reflect UDP length. |
* Make mbuf data length reflect UDP length. |
* If not enough data to reflect UDP length, drop. |
* If not enough data to reflect UDP length, drop. |
|
|
if (opts) |
if (opts) |
m_freem(opts); |
m_freem(opts); |
} |
} |
#endif |
#endif /*UDP6*/ |
|
|
/* |
/* |
* Notify a udp user of an asynchronous error; |
* Notify a udp user of an asynchronous error; |