Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/udp_usrreq.c
Show First 20 Lines • Show All 485 Lines • ▼ Show 20 Lines | while ((inp = inp_next(&inpi)) != NULL) { | ||||
* will never clear these options after setting them. | * will never clear these options after setting them. | ||||
*/ | */ | ||||
if ((inp->inp_socket->so_options & | if ((inp->inp_socket->so_options & | ||||
(SO_REUSEPORT|SO_REUSEPORT_LB|SO_REUSEADDR)) == 0) { | (SO_REUSEPORT|SO_REUSEPORT_LB|SO_REUSEADDR)) == 0) { | ||||
INP_RUNLOCK(inp); | INP_RUNLOCK(inp); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
m_freem(m); | |||||
if (appends == 0) { | if (appends == 0) { | ||||
/* | /* | ||||
* No matching pcb found; discard datagram. (No need | * No matching pcb found; discard datagram. (No need | ||||
* to send an ICMP Port Unreachable for a broadcast | * to send an ICMP Port Unreachable for a broadcast | ||||
* or multicast datgram.) | * or multicast datgram.) | ||||
*/ | */ | ||||
UDPSTAT_INC(udps_noport); | UDPSTAT_INC(udps_noport); | ||||
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) | if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) | ||||
UDPSTAT_INC(udps_noportmcast); | UDPSTAT_INC(udps_noportmcast); | ||||
else | else | ||||
UDPSTAT_INC(udps_noportbcast); | UDPSTAT_INC(udps_noportbcast); | ||||
} | } | ||||
m_freem(m); | |||||
return (IPPROTO_DONE); | return (IPPROTO_DONE); | ||||
} | } | ||||
int | int | ||||
udp_input(struct mbuf **mp, int *offp, int proto) | udp_input(struct mbuf **mp, int *offp, int proto) | ||||
{ | { | ||||
struct ip *ip; | struct ip *ip; | ||||
▲ Show 20 Lines • Show All 116 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); | ||||
} | } | ||||
} | } | ||||
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || | if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || | ||||
in_broadcast(ip->ip_dst, ifp)) | in_broadcast(ip->ip_dst, ifp)) | ||||
return (udp_multi_input(m, proto, udp_in)); | return (udp_multi_input(m, proto, udp_in)); | ||||
pcbinfo = udp_get_inpcbinfo(proto); | pcbinfo = udp_get_inpcbinfo(proto); | ||||
/* | /* | ||||
* Locate pcb for datagram. | * Locate pcb for datagram. | ||||
* | * | ||||
* Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. | * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 1,148 Lines • Show Last 20 Lines |