]> git.baikalelectronics.ru Git - kernel.git/commit
l2tp: remove build_header callback in struct l2tp_session
authorTom Parkin <tparkin@katalix.com>
Tue, 28 Jul 2020 17:20:31 +0000 (18:20 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Jul 2020 23:45:31 +0000 (16:45 -0700)
commit158166fb86b0cc3014faa2344bad3b11cba20fa1
tree41cbb7bcc84e25b912c7ebd2dca34685724d81ee
parent8990eeeba630c16d527860c2365e7e8e01e09cd8
l2tp: remove build_header callback in struct l2tp_session

The structure of an L2TP data packet header varies depending on the
version of the L2TP protocol being used.

struct l2tp_session used to have a build_header callback to abstract
this difference away.  It's clearer to simply choose the correct
function to use when building the data packet (and we save on the
function pointer in the session structure).

This approach does mean dereferencing the parent tunnel structure in
order to determine the tunnel version, but we're doing that in the
transmit path in any case.

Signed-off-by: Tom Parkin <tparkin@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_core.c
net/l2tp/l2tp_core.h