]> git.baikalelectronics.ru Git - kernel.git/commit
l2tp: rework socket comparison in __l2tp_ip*_bind_lookup()
authorGuillaume Nault <g.nault@alphalink.fr>
Fri, 6 Jan 2017 19:03:57 +0000 (20:03 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Jan 2017 03:18:56 +0000 (22:18 -0500)
commit0d710cda408674f7fe2ee02684d347a0ba846346
tree17f94b9c736444f4bccc732f586171a2505fdbe8
parentbbe5c4c6a78ac08c17660f6f6fc86ba0a976c9fd
l2tp: rework socket comparison in __l2tp_ip*_bind_lookup()

Split conditions, so that each test becomes clearer.

Also, for l2tp_ip, check if "laddr" is 0. This prevents a socket from
binding to the unspecified address when other sockets are already bound
using the same device (if any), connection ID and namespace.

Same thing for l2tp_ip6: add ipv6_addr_any(laddr) and
ipv6_addr_any(raddr) tests to ensure that an IPv6 unspecified address
passed as parameter is properly treated a wildcard.

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