Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/udp_usrreq.c
Show First 20 Lines • Show All 679 Lines • ▼ Show 20 Lines | if (udp_log_in_vain) { | ||||
char src[INET_ADDRSTRLEN]; | char src[INET_ADDRSTRLEN]; | ||||
char dst[INET_ADDRSTRLEN]; | char dst[INET_ADDRSTRLEN]; | ||||
log(LOG_INFO, | log(LOG_INFO, | ||||
"Connection attempt to UDP %s:%d from %s:%d\n", | "Connection attempt to UDP %s:%d from %s:%d\n", | ||||
inet_ntoa_r(ip->ip_dst, dst), ntohs(uh->uh_dport), | inet_ntoa_r(ip->ip_dst, dst), ntohs(uh->uh_dport), | ||||
inet_ntoa_r(ip->ip_src, src), ntohs(uh->uh_sport)); | inet_ntoa_r(ip->ip_src, src), ntohs(uh->uh_sport)); | ||||
} | } | ||||
UDP_PROBE(receive, NULL, NULL, ip, NULL, uh); | |||||
UDPSTAT_INC(udps_noport); | UDPSTAT_INC(udps_noport); | ||||
if (m->m_flags & (M_BCAST | M_MCAST)) { | if (m->m_flags & (M_BCAST | M_MCAST)) { | ||||
UDPSTAT_INC(udps_noportbcast); | UDPSTAT_INC(udps_noportbcast); | ||||
goto badunlocked; | goto badunlocked; | ||||
} | } | ||||
if (V_udp_blackhole) | if (V_udp_blackhole) | ||||
goto badunlocked; | goto badunlocked; | ||||
if (badport_bandlim(BANDLIM_ICMP_UNREACH) < 0) | if (badport_bandlim(BANDLIM_ICMP_UNREACH) < 0) | ||||
goto badunlocked; | goto badunlocked; | ||||
*ip = save_ip; | *ip = save_ip; | ||||
icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0); | icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0); | ||||
return (IPPROTO_DONE); | return (IPPROTO_DONE); | ||||
} | } | ||||
/* | /* | ||||
* Check the minimum TTL for socket. | * Check the minimum TTL for socket. | ||||
*/ | */ | ||||
INP_RLOCK_ASSERT(inp); | INP_RLOCK_ASSERT(inp); | ||||
if (inp->inp_ip_minttl && inp->inp_ip_minttl > ip->ip_ttl) { | if (inp->inp_ip_minttl && inp->inp_ip_minttl > ip->ip_ttl) { | ||||
UDP_PROBE(receive, NULL, inp, ip, inp, uh); | |||||
INP_RUNLOCK(inp); | INP_RUNLOCK(inp); | ||||
m_freem(m); | m_freem(m); | ||||
return (IPPROTO_DONE); | return (IPPROTO_DONE); | ||||
} | } | ||||
if (cscov_partial) { | if (cscov_partial) { | ||||
struct udpcb *up; | struct udpcb *up; | ||||
up = intoudpcb(inp); | up = intoudpcb(inp); | ||||
▲ Show 20 Lines • Show All 1,088 Lines • Show Last 20 Lines |