version 1.226.2.2, 2017/01/07 08:56:51 |
version 1.227, 2016/10/19 01:13:01 |
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 356 udp_input(struct mbuf *m, ...) |
|
Line 355 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 1140 udp_purgeif(struct socket *so, struct if |
|
Line 1126 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; |