]> git.baikalelectronics.ru Git - kernel.git/commit
l2tp: remove useless duplicate session detection in l2tp_netlink
authorGuillaume Nault <g.nault@alphalink.fr>
Tue, 11 Apr 2017 11:12:13 +0000 (13:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 11 Apr 2017 17:48:09 +0000 (13:48 -0400)
commit6967c1cd5d774866617aeb72efa9121f4e599a54
treef2ad08326ed460dda75cd79019d781a0f9dd1441
parent3bbcdc8d1d3664cbc306c2a573baf32022bed374
l2tp: remove useless duplicate session detection in l2tp_netlink

There's no point in checking for duplicate sessions at the beginning of
l2tp_nl_cmd_session_create(); the ->session_create() callbacks already
return -EEXIST when the session already exists.

Furthermore, even if l2tp_session_find() returns NULL, a new session
might be created right after the test. So relying on ->session_create()
to avoid duplicate session is the only sane behaviour.

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