Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b2531bd authored by Folkert van Heusden's avatar Folkert van Heusden Committed by David S. Miller
Browse files

[TCP]: Optimize check in port-allocation code.

parent 20cc6bef
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -222,10 +222,13 @@ static int tcp_v4_get_port(struct sock *sk, unsigned short snum)
		int rover;

		spin_lock(&tcp_portalloc_lock);
		if (tcp_port_rover < low)
			rover = low;
		else
			rover = tcp_port_rover;
		do {
			rover++;
			if (rover < low || rover > high)
			if (rover > high)
				rover = low;
			head = &tcp_bhash[tcp_bhashfn(rover)];
			spin_lock(&head->lock);