Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109411504
D38015.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D38015.diff
View Options
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -2225,7 +2225,7 @@
struct ifnet *ifp, uint8_t numa_domain)
{
struct inpcbhead *head;
- struct inpcb *inp, *tmpinp;
+ struct inpcb *inp;
u_short fport = fport_arg, lport = lport_arg;
KASSERT((lookupflags & ~(INPLOOKUP_WILDCARD)) == 0,
@@ -2239,7 +2239,6 @@
/*
* First look for an exact match.
*/
- tmpinp = NULL;
head = &pcbinfo->ipi_hashbase[INP_PCBHASH(&faddr, lport, fport,
pcbinfo->ipi_hashmask)];
CK_LIST_FOREACH(inp, head, inp_hash) {
@@ -2251,20 +2250,9 @@
if (inp->inp_faddr.s_addr == faddr.s_addr &&
inp->inp_laddr.s_addr == laddr.s_addr &&
inp->inp_fport == fport &&
- inp->inp_lport == lport) {
- /*
- * XXX We should be able to directly return
- * the inp here, without any checks.
- * Well unless both bound with SO_REUSEPORT?
- */
- if (prison_flag(inp->inp_cred, PR_IP4))
- return (inp);
- if (tmpinp == NULL)
- tmpinp = inp;
- }
+ inp->inp_lport == lport)
+ return (inp);
}
- if (tmpinp != NULL)
- return (tmpinp);
/*
* Then look for a wildcard match, if requested.
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -966,7 +966,7 @@
int lookupflags, struct ifnet *ifp, uint8_t numa_domain)
{
struct inpcbhead *head;
- struct inpcb *inp, *tmpinp;
+ struct inpcb *inp;
u_short fport = fport_arg, lport = lport_arg;
KASSERT((lookupflags & ~(INPLOOKUP_WILDCARD)) == 0,
@@ -981,7 +981,6 @@
/*
* First look for an exact match.
*/
- tmpinp = NULL;
head = &pcbinfo->ipi_hashbase[INP6_PCBHASH(faddr, lport, fport,
pcbinfo->ipi_hashmask)];
CK_LIST_FOREACH(inp, head, inp_hash) {
@@ -991,20 +990,9 @@
if (IN6_ARE_ADDR_EQUAL(&inp->in6p_faddr, faddr) &&
IN6_ARE_ADDR_EQUAL(&inp->in6p_laddr, laddr) &&
inp->inp_fport == fport &&
- inp->inp_lport == lport) {
- /*
- * XXX We should be able to directly return
- * the inp here, without any checks.
- * Well unless both bound with SO_REUSEPORT?
- */
- if (prison_flag(inp->inp_cred, PR_IP6))
- return (inp);
- if (tmpinp == NULL)
- tmpinp = inp;
- }
+ inp->inp_lport == lport)
+ return (inp);
}
- if (tmpinp != NULL)
- return (tmpinp);
/*
* Then look for a wildcard match, if requested.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 5, 5:39 PM (20 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16478155
Default Alt Text
D38015.diff (2 KB)
Attached To
Mode
D38015: inpcb: immediately return matching pcb on lookup
Attached
Detach File
Event Timeline
Log In to Comment