version 1.217.4.6, 2016/07/09 20:25:22 |
version 1.217.4.7, 2016/12/05 10:55:28 |
Line 75 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 75 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#include "opt_inet_csum.h" |
#include "opt_inet_csum.h" |
#include "opt_ipkdb.h" |
#include "opt_ipkdb.h" |
#include "opt_mbuftrace.h" |
#include "opt_mbuftrace.h" |
|
#include "opt_net_mpsafe.h" |
#endif |
#endif |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
Line 355 udp_input(struct mbuf *m, ...) |
|
Line 356 udp_input(struct mbuf *m, ...) |
|
UDP_STATINC(UDP_STAT_HDROPS); |
UDP_STATINC(UDP_STAT_HDROPS); |
return; |
return; |
} |
} |
|
/* |
|
* Enforce alignment requirements that are violated in |
|
* some cases, see kern/50766 for details. |
|
*/ |
|
if (UDP_HDR_ALIGNED_P(uh) == 0) { |
|
m = m_copyup(m, iphlen + sizeof(struct udphdr), 0); |
|
if (m == NULL) { |
|
UDP_STATINC(UDP_STAT_HDROPS); |
|
return; |
|
} |
|
ip = mtod(m, struct ip *); |
|
uh = (struct udphdr *)(mtod(m, char *) + iphlen); |
|
} |
KASSERT(UDP_HDR_ALIGNED_P(uh)); |
KASSERT(UDP_HDR_ALIGNED_P(uh)); |
|
|
/* destination port of 0 is illegal, based on RFC768. */ |
/* destination port of 0 is illegal, based on RFC768. */ |
Line 1126 udp_purgeif(struct socket *so, struct if |
|
Line 1140 udp_purgeif(struct socket *so, struct if |
|
int s; |
int s; |
|
|
s = splsoftnet(); |
s = splsoftnet(); |
|
#ifndef NET_MPSAFE |
mutex_enter(softnet_lock); |
mutex_enter(softnet_lock); |
|
#endif |
in_pcbpurgeif0(&udbtable, ifp); |
in_pcbpurgeif0(&udbtable, ifp); |
in_purgeif(ifp); |
in_purgeif(ifp); |
in_pcbpurgeif(&udbtable, ifp); |
in_pcbpurgeif(&udbtable, ifp); |
|
#ifndef NET_MPSAFE |
mutex_exit(softnet_lock); |
mutex_exit(softnet_lock); |
|
#endif |
splx(s); |
splx(s); |
|
|
return 0; |
return 0; |
Line 1339 udp4_espinudp(struct mbuf **mp, int off, |
|
Line 1357 udp4_espinudp(struct mbuf **mp, int off, |
|
((u_int16_t *)(tag + 1))[1] = dport; |
((u_int16_t *)(tag + 1))[1] = dport; |
m_tag_prepend(m, tag); |
m_tag_prepend(m, tag); |
|
|
#ifdef IPSEC |
|
if (ipsec_used) |
if (ipsec_used) |
ipsec4_common_input(m, iphdrlen, IPPROTO_ESP); |
ipsec4_common_input(m, iphdrlen, IPPROTO_ESP); |
/* XXX: else */ |
/* XXX: else */ |
#else |
|
esp4_input(m, iphdrlen); |
|
#endif |
|
|
|
/* We handled it, it shouldn't be handled by UDP */ |
/* We handled it, it shouldn't be handled by UDP */ |
*mp = NULL; /* avoid free by caller ... */ |
*mp = NULL; /* avoid free by caller ... */ |