Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/udp6_usrreq.c
Context not available. | |||||
return (0); | return (0); | ||||
} | } | ||||
static bool | |||||
udp6_inpcb_eq_ip6_uh(struct inpcb *inp, struct ip6_hdr *ip6, struct udphdr *uh) | |||||
{ | |||||
if ((inp->inp_vflag & INP_IPV6) == 0) | |||||
return false; | |||||
if (inp->inp_lport != uh->uh_dport) | |||||
return false; | |||||
if (inp->inp_fport != 0 && | |||||
inp->inp_fport != uh->uh_sport) | |||||
return false; | |||||
if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) { | |||||
if (!IN6_ARE_ADDR_EQUAL(&inp->in6p_laddr, | |||||
&ip6->ip6_dst)) | |||||
return false; | |||||
} | |||||
if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) { | |||||
if (!IN6_ARE_ADDR_EQUAL(&inp->in6p_faddr, | |||||
&ip6->ip6_src) || | |||||
inp->inp_fport != uh->uh_sport) | |||||
return false; | |||||
} | |||||
return true; | |||||
} | |||||
int | int | ||||
udp6_input(struct mbuf **mp, int *offp, int proto) | udp6_input(struct mbuf **mp, int *offp, int proto) | ||||
{ | { | ||||
Context not available. | |||||
pcblist = udp_get_pcblist(nxt); | pcblist = udp_get_pcblist(nxt); | ||||
last = NULL; | last = NULL; | ||||
CK_LIST_FOREACH(inp, pcblist, inp_list) { | CK_LIST_FOREACH(inp, pcblist, inp_list) { | ||||
if ((inp->inp_vflag & INP_IPV6) == 0) | if (!udp6_inpcb_eq_ip6_uh(inp, ip6, uh)) | ||||
continue; | continue; | ||||
if (inp->inp_lport != uh->uh_dport) | |||||
continue; | |||||
if (inp->inp_fport != 0 && | |||||
inp->inp_fport != uh->uh_sport) | |||||
continue; | |||||
if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) { | |||||
if (!IN6_ARE_ADDR_EQUAL(&inp->in6p_laddr, | |||||
&ip6->ip6_dst)) | |||||
continue; | |||||
} | |||||
if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) { | |||||
if (!IN6_ARE_ADDR_EQUAL(&inp->in6p_faddr, | |||||
&ip6->ip6_src) || | |||||
inp->inp_fport != uh->uh_sport) | |||||
continue; | |||||
} | |||||
/* | /* | ||||
* XXXRW: Because we weren't holding either the inpcb | |||||
* or the hash lock when we checked for a match | |||||
* before, we should probably recheck now that the | |||||
* inpcb lock is (supposed to be) held. | |||||
*/ | |||||
/* | |||||
donner: Why is this remark solved?
I do see no code for handling the concern nor any documentation why… | |||||
* Handle socket delivery policy for any-source | * Handle socket delivery policy for any-source | ||||
* and source-specific multicast. [RFC3678] | * and source-specific multicast. [RFC3678] | ||||
*/ | */ | ||||
Context not available. | |||||
int blocked; | int blocked; | ||||
INP_RLOCK(inp); | INP_RLOCK(inp); | ||||
if (__predict_false(inp->inp_flags2 & INP_FREED)) { | if (__predict_false(inp->inp_flags2 & INP_FREED) || !udp6_inpcb_eq_ip6_uh(inp, ip6, uh)) { | ||||
Not Done Inline ActionsI do not get the second condition. donner: I do not get the second condition.
This was already evaluated in line 348 above and caused a… | |||||
INP_RUNLOCK(inp); | INP_RUNLOCK(inp); | ||||
continue; | continue; | ||||
} | } | ||||
Context not available. |
Why is this remark solved?
I do see no code for handling the concern nor any documentation why it is not justified.