Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/udp_usrreq.c
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | |||||
SYSCTL_INT(_net_inet_udp, OID_AUTO, log_in_vain, CTLFLAG_RW, | SYSCTL_INT(_net_inet_udp, OID_AUTO, log_in_vain, CTLFLAG_RW, | ||||
&udp_log_in_vain, 0, "Log all incoming UDP packets"); | &udp_log_in_vain, 0, "Log all incoming UDP packets"); | ||||
VNET_DEFINE(int, udp_blackhole) = 0; | VNET_DEFINE(int, udp_blackhole) = 0; | ||||
SYSCTL_INT(_net_inet_udp, OID_AUTO, blackhole, CTLFLAG_VNET | CTLFLAG_RW, | SYSCTL_INT(_net_inet_udp, OID_AUTO, blackhole, CTLFLAG_VNET | CTLFLAG_RW, | ||||
&VNET_NAME(udp_blackhole), 0, | &VNET_NAME(udp_blackhole), 0, | ||||
"Do not send port unreachables for refused connects"); | "Do not send port unreachables for refused connects"); | ||||
static VNET_DEFINE(int, udp_require_l2_bcast) = 1; | |||||
SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET | CTLFLAG_RW, | |||||
&VNET_NAME(udp_require_l2_bcast), 0, | |||||
"Only treat packets sent to an L2 broadcast address as broadcast packets"); | |||||
u_long udp_sendspace = 9216; /* really max datagram size */ | u_long udp_sendspace = 9216; /* really max datagram size */ | ||||
SYSCTL_ULONG(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW, | SYSCTL_ULONG(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW, | ||||
&udp_sendspace, 0, "Maximum outgoing UDP datagram size"); | &udp_sendspace, 0, "Maximum outgoing UDP datagram size"); | ||||
u_long udp_recvspace = 40 * (1024 + | u_long udp_recvspace = 40 * (1024 + | ||||
#ifdef INET6 | #ifdef INET6 | ||||
sizeof(struct sockaddr_in6) | sizeof(struct sockaddr_in6) | ||||
#else | #else | ||||
▲ Show 20 Lines • Show All 381 Lines • ▼ Show 20 Lines | if (proto == IPPROTO_UDP) { | ||||
/* XXX: What is the right UDPLite MIB counter here? */ | /* XXX: What is the right UDPLite MIB counter here? */ | ||||
m_freem(m); | m_freem(m); | ||||
return (IPPROTO_DONE); | return (IPPROTO_DONE); | ||||
} | } | ||||
} | } | ||||
pcbinfo = udp_get_inpcbinfo(proto); | pcbinfo = udp_get_inpcbinfo(proto); | ||||
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || | if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || | ||||
in_broadcast(ip->ip_dst, ifp)) { | ((!VNET_NAME(udp_require_l2_bcast) || m->m_flags & M_BCAST) && | ||||
in_broadcast(ip->ip_dst, ifp))) { | |||||
struct inpcb *last; | struct inpcb *last; | ||||
struct inpcbhead *pcblist; | struct inpcbhead *pcblist; | ||||
struct ip_moptions *imo; | struct ip_moptions *imo; | ||||
INP_INFO_RLOCK(pcbinfo); | INP_INFO_RLOCK(pcbinfo); | ||||
pcblist = udp_get_pcblist(proto); | pcblist = udp_get_pcblist(proto); | ||||
last = NULL; | last = NULL; | ||||
LIST_FOREACH(inp, pcblist, inp_list) { | LIST_FOREACH(inp, pcblist, inp_list) { | ||||
▲ Show 20 Lines • Show All 1,418 Lines • Show Last 20 Lines |