]> git.baikalelectronics.ru Git - kernel.git/commit
net: Swap ordering of tests in ip_route_input_mc
authorAlexander Duyck <aduyck@mirantis.com>
Mon, 28 Sep 2015 18:10:38 +0000 (11:10 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Sep 2015 23:27:47 +0000 (16:27 -0700)
commit13007d943b3eff7d8f8673b78adf992398f33e22
tree0201cb3b7c7712b357c198b1fc942242916d062b
parentd3d0245fd2385cedf4ff92a5aa2c6d0cc9b96cc6
net: Swap ordering of tests in ip_route_input_mc

This patch just swaps the ordering of one of the conditional tests in
ip_route_input_mc.  Specifically it swaps the testing for the source
address to see if it is loopback, and the test to see if we allow a
loopback source address.

The reason for swapping these two tests is because it is much faster to
test if an address is loopback than it is to dereference several pointers
to get at the net structure to see if the use of loopback is allowed.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c