]> git.baikalelectronics.ru Git - kernel.git/commit
l2tp: fix address test in __l2tp_ip6_bind_lookup()
authorGuillaume Nault <g.nault@alphalink.fr>
Tue, 29 Nov 2016 12:09:48 +0000 (13:09 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Nov 2016 19:14:08 +0000 (14:14 -0500)
commit3e1fb136bdc79f38224ab2d0ffe5654a8edd1ea9
tree9546bf8fd1837769d8ff63d13acac5a1f57e5a9a
parent3561e65b7dce5a411ab6945ec77dd3e92877b5d8
l2tp: fix address test in __l2tp_ip6_bind_lookup()

The '!(addr && ipv6_addr_equal(addr, laddr))' part of the conditional
matches if addr is NULL or if addr != laddr.
But the intend of __l2tp_ip6_bind_lookup() is to find a sockets with
the same address, so the ipv6_addr_equal() condition needs to be
inverted.

For better clarity and consistency with the rest of the expression, the
(!X || X == Y) notation is used instead of !(X && X != Y).

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_ip6.c