]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
l2tp: ppp: use max L2TP header size for PPP channel hdrlen
authorQingfang Deng <dqfext@gmail.com>
Tue, 17 Mar 2026 05:41:40 +0000 (13:41 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 19 Mar 2026 10:00:04 +0000 (11:00 +0100)
commit9f4960b94f1a044f76da98a765d6cbd294c22c92
tree191568d43276520bd0b4aef92c4da0c9ec7aa125
parent96a584db75bb21781562dc79f11932ce38a1205f
l2tp: ppp: use max L2TP header size for PPP channel hdrlen

chan.hdrlen is read once at channel registration by
ppp_register_net_channel(), and used to set the PPP net device's
hard_header_len. It was set to PPPOL2TP_L2TP_HDR_SIZE_NOSEQ (6), which
is 4 bytes too small if sequence numbers are later enabled via
setsockopt(PPPOL2TP_SO_SENDSEQ), causing unnecessary skb reallocations
on the TX path.

The setsockopt handler attempted to change netdev's hard_header_len by
updating chan.hdrlen, but the PPP layer never re-reads it after the
registration, so the update had no effect.

To avoid the unnecessary reallocations, set chan.hdrlen to
PPPOL2TP_L2TP_HDR_SIZE_SEQ (10) unconditionally at registration and
remove the ineffective update in the setsockopt callback.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://patch.msgid.link/20260317054141.524879-1-dqfext@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/l2tp/l2tp_ppp.c