Skip to content

l2tp: rework pppol2tp ioctl handling

Guillaume Nault netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8l2tp: define l2tp_tunnel_uses_xfrm()net/l2tp/l2tp_core.h net/l2tp/l2tp_netlink.c net/l2tp/l2tp_ppp.c+21 -100 replies
2/8l2tp: split l2tp_session_get()net/l2tp/l2tp_core.c net/l2tp/l2tp_core.h net/l2tp/l2tp_ip.c +3 more+36 -360 replies
3/8l2tp: simplify pppol2tp_ioctl()net/l2tp/l2tp_ppp.c+6 -270 replies
4/8l2tp: handle PPPIOC[GS]MRU and PPPIOC[GS]FLAGS in pppol2tp_ioctl()net/l2tp/l2tp_ppp.c+44 -290 replies
5/8l2tp: remove pppol2tp_tunnel_ioctl()net/l2tp/l2tp_ppp.c+53 -790 replies
6/8l2tp: remove pppol2tp_session_ioctl()include/uapi/linux/ppp-ioctl.h net/l2tp/l2tp_ppp.c+4 -480 replies
7/8l2tp: zero out stats in pppol2tp_copy_stats()net/l2tp/l2tp_ppp.c+3 -40 replies
8/8l2tp: let pppol2tp_ioctl() fallback to dev_ioctl()net/l2tp/l2tp_ppp.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/8] l2tp: rework pppol2tp ioctl handling

The current ioctl() handling code can be simplified. It tests for non-relevant conditions and uselessly holds sockets. Once useless code is removed, it becomes even simpler to let pppol2tp_ioctl() handle commands directly, rather than dispatch them to pppol2tp_tunnel_ioctl() or pppol2tp_session_ioctl(). That is the approach taken by this series.

Patch #1 and #2 define helper functions aimed at simplifying the rest of the patch set.

Patch #3 drops useless tests in pppol2p_ioctl() and avoid holding a refcount on the socket.

Patches #4, #5 and #6 are the core of the series. They let pppol2tp_ioctl() handle all ioctls and drop the tunnel and session specific functions.

Then patch #6 brings a little bit of consolidation.

Finally, patch #7 takes advantage of the simplified code to make pppol2tp sockets compatible with dev_ioctl(). Certainly not a killer feature, but it is trivial and it is always nice to see l2tp getting better integration with the rest of the stack.

Guillaume Nault (8):
l2tp: define l2tp_tunnel_uses_xfrm()
l2tp: split l2tp_session_get()
l2tp: simplify pppol2tp_ioctl()
l2tp: handle PPPIOC[GS]MRU and PPPIOC[GS]FLAGS in pppol2tp_ioctl()
l2tp: remove pppol2tp_tunnel_ioctl()
l2tp: remove pppol2tp_session_ioctl()
l2tp: zero out stats in pppol2tp_copy_stats()
l2tp: let pppol2tp_ioctl() fallback to dev_ioctl()

 include/uapi/linux/ppp-ioctl.h |   2 +-
 net/l2tp/l2tp_core.c           |  50 +++----
 net/l2tp/l2tp_core.h           |  25 +++-
 net/l2tp/l2tp_ip.c             |   2 +-
 net/l2tp/l2tp_ip6.c            |   2 +-
 net/l2tp/l2tp_netlink.c        |  11 +-
 net/l2tp/l2tp_ppp.c            | 240 +++++++++++----------------------
 7 files changed, 133 insertions(+), 199 deletions(-)
Signature · 1 line
2.18.0