Commit 13e3f334 authored by Peter Lei's avatar Peter Lei Committed by Gleb Smirnoff
Browse files

in_pcb: fix TCP local ephemeral port accounting

Fix logic error causing UDP(-Lite) local ephemeral port bindings
to count against the TCP allocation counter, potentially causing
TCP to go from random to sequential port allocation mode prematurely.
parent 5577aa33
......@@ -748,7 +748,7 @@ in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, u_short *lportp,
if (first == last)
dorandom = 0;
/* Make sure to not include UDP(-Lite) packets in the count. */
if (pcbinfo != &V_udbinfo || pcbinfo != &V_ulitecbinfo)
if (pcbinfo != &V_udbinfo && pcbinfo != &V_ulitecbinfo)
* Instead of having two loops further down counting up or down
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment