]> git.baikalelectronics.ru Git - kernel.git/commit
inet: don't check for bind conflicts twice when searching for a port
authorJosef Bacik <jbacik@fb.com>
Tue, 17 Jan 2017 15:51:04 +0000 (07:51 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Jan 2017 18:04:29 +0000 (13:04 -0500)
commit7ee2bf609d3123f6f06ca5d8843c3ff7703c22f5
treeec04f3dcdbd51a884bc4a77711f5c3b0caa6df26
parent7da1eb3768455eceec99ffcf511f41d1fafbd048
inet: don't check for bind conflicts twice when searching for a port

This is just wasted time, we've already found a tb that doesn't have a bind
conflict, and we don't drop the head lock so scanning again isn't going to give
us a different answer.  Instead move the tb->reuse setting logic outside of the
found_tb path and put it in the success: path.  Then make it so that we don't
goto again if we find a bind conflict in the found_tb path as we won't reach
this anymore when we are scanning for an ephemeral port.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/inet_connection_sock.c