Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145586756
D17109.id49449.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D17109.id49449.diff
View Options
Index: head/sys/netinet6/in6_pcb.c
===================================================================
--- head/sys/netinet6/in6_pcb.c
+++ head/sys/netinet6/in6_pcb.c
@@ -873,10 +873,9 @@
const struct in6_addr *laddr, uint16_t lport, const struct in6_addr *faddr,
uint16_t fport, int lookupflags)
{
- struct inpcb *local_wild = NULL;
+ struct inpcb *local_wild;
const struct inpcblbgrouphead *hdr;
struct inpcblbgroup *grp;
- struct inpcblbgroup *grp_local_wild;
uint32_t idx;
INP_HASH_LOCK_ASSERT(pcbinfo);
@@ -893,33 +892,24 @@
* - Load balanced group does not contain jailed sockets.
* - Load balanced does not contain IPv4 mapped INET6 wild sockets.
*/
+ local_wild = NULL;
CK_LIST_FOREACH(grp, hdr, il_list) {
#ifdef INET
if (!(grp->il_vflag & INP_IPV6))
continue;
#endif
- if (grp->il_lport == lport) {
- idx = 0;
- int pkt_hash = INP_PCBLBGROUP_PKTHASH(
- INP6_PCBHASHKEY(faddr), lport, fport);
+ if (grp->il_lport != lport)
+ continue;
- idx = pkt_hash % grp->il_inpcnt;
-
- if (IN6_ARE_ADDR_EQUAL(&grp->il6_laddr, laddr)) {
- return (grp->il_inp[idx]);
- } else {
- if (IN6_IS_ADDR_UNSPECIFIED(&grp->il6_laddr) &&
- (lookupflags & INPLOOKUP_WILDCARD)) {
- local_wild = grp->il_inp[idx];
- grp_local_wild = grp;
- }
- }
- }
+ idx = INP_PCBLBGROUP_PKTHASH(INP6_PCBHASHKEY(faddr), lport,
+ fport) % grp->il_inpcnt;
+ if (IN6_ARE_ADDR_EQUAL(&grp->il6_laddr, laddr))
+ return (grp->il_inp[idx]);
+ if (IN6_IS_ADDR_UNSPECIFIED(&grp->il6_laddr) &&
+ (lookupflags & INPLOOKUP_WILDCARD) != 0)
+ local_wild = grp->il_inp[idx];
}
- if (local_wild != NULL) {
- return (local_wild);
- }
- return (NULL);
+ return (local_wild);
}
#ifdef PCBGROUP
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 22, 8:46 PM (2 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28943282
Default Alt Text
D17109.id49449.diff (1 KB)
Attached To
Mode
D17109: Style fixes for in6_pcblookup_lbgroup().
Attached
Detach File
Event Timeline
Log In to Comment