aboutsummaryrefslogtreecommitdiffstats
path: root/net/l2tp
diff options
context:
space:
mode:
authorR. Parameswaran <parameswaran.r7@gmail.com>2017-04-12 21:31:04 -0400
committerDavid S. Miller <davem@davemloft.net>2017-04-17 13:01:48 -0400
commit57240d007816486131bee88cd474c2a71f0fe224 (patch)
treeeb6a94027fd814fd1a468ee127340b6201056bfd /net/l2tp
parent4a6e3c5def13c91adf2acc613837001f09af3baa (diff)
l2tp: device MTU setup, tunnel socket needs a lock
The MTU overhead calculation in L2TP device set-up merged via commit b784e7ebfce8cfb16c6f95e14e8532d0768ab7ff needs to be adjusted to lock the tunnel socket while referencing the sub-data structures to derive the socket's IP overhead. Reported-by: Guillaume Nault <g.nault@alphalink.fr> Tested-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: R. Parameswaran <rparames@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp')
-rw-r--r--net/l2tp/l2tp_eth.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c
index 138566a63123..b722d559c544 100644
--- a/net/l2tp/l2tp_eth.c
+++ b/net/l2tp/l2tp_eth.c
@@ -225,7 +225,9 @@ static void l2tp_eth_adjust_mtu(struct l2tp_tunnel *tunnel,
225 dev->needed_headroom += session->hdr_len; 225 dev->needed_headroom += session->hdr_len;
226 return; 226 return;
227 } 227 }
228 lock_sock(tunnel->sock);
228 l3_overhead = kernel_sock_ip_overhead(tunnel->sock); 229 l3_overhead = kernel_sock_ip_overhead(tunnel->sock);
230 release_sock(tunnel->sock);
229 if (l3_overhead == 0) { 231 if (l3_overhead == 0) {
230 /* L3 Overhead couldn't be identified, this could be 232 /* L3 Overhead couldn't be identified, this could be
231 * because tunnel->sock was NULL or the socket's 233 * because tunnel->sock was NULL or the socket's