1. 30 Jul, 2020 9 commits
    • David S. Miller's avatar
      Merge branch 'l2tp-tidy-up-l2tp-core-API' · 2a043e9c
      David S. Miller authored
      Tom Parkin says:
      
      ====================
      l2tp: tidy up l2tp core API
      
      This short series makes some minor tidyup changes to the L2TP core API.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2a043e9c
    • Tom Parkin's avatar
      l2tp: improve API documentation in l2tp_core.h · 340bb1ac
      Tom Parkin authored
      * Improve the description of the key l2tp subsystem data structures.
       * Add high-level description of the main APIs for interacting with l2tp
         core.
       * Add documentation for the l2tp netlink session command callbacks.
       * Document the session pseudowire callbacks.
      Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      340bb1ac
    • Tom Parkin's avatar
      l2tp: tweak exports for l2tp_recv_common and l2tp_ioctl · ca7885db
      Tom Parkin authored
      All of the l2tp subsystem's exported symbols are exported using
      EXPORT_SYMBOL_GPL, except for l2tp_recv_common and l2tp_ioctl.
      
      These functions alone are not useful without the rest of the l2tp
      infrastructure, so there's no practical benefit to these symbols using a
      different export policy.
      
      Change these exports to use EXPORT_SYMBOL_GPL for consistency with the
      rest of l2tp.
      Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ca7885db
    • Tom Parkin's avatar
      l2tp: remove build_header callback in struct l2tp_session · 2dedab6f
      Tom Parkin authored
      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: default avatarTom Parkin <tparkin@katalix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2dedab6f
    • Tom Parkin's avatar
      l2tp: return void from l2tp_session_delete · 628703f5
      Tom Parkin authored
      l2tp_session_delete is used to schedule a session instance for deletion.
      The function itself always returns zero, and none of its direct callers
      check its return value, so have the function return void.
      
      This change de-facto changes the l2tp netlink session_delete callback
      prototype since all pseudowires currently use l2tp_session_delete for
      their implementation of that operation.
      Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      628703f5
    • Tom Parkin's avatar
      l2tp: don't export tunnel and session free functions · 52016e25
      Tom Parkin authored
      Tunnel and session instances are reference counted, and shouldn't be
      directly freed by pseudowire code.
      
      Rather than exporting l2tp_tunnel_free and l2tp_session_free, make them
      private to l2tp_core.c, and export the refcount functions instead.
      
      In order to do this, the refcount functions cannot be declared as
      inline.  Since the codepaths which take and drop tunnel and session
      references are not directly in the datapath this shouldn't cause
      performance issues.
      Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      52016e25
    • Tom Parkin's avatar
      l2tp: don't export __l2tp_session_unhash · b2aecfe8
      Tom Parkin authored
      When __l2tp_session_unhash was first added it was used outside of
      l2tp_core.c, but that's no longer the case.
      
      As such, there's no longer a need to export the function.  Make it
      private inside l2tp_core.c, and relocate it to avoid having to declare
      the function prototype in l2tp_core.h.
      
      Since the function is no longer used outside l2tp_core.c, remove the
      "__" prefix since we don't need to indicate anything special about its
      expected use to callers.
      Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b2aecfe8
    • Jian Yang's avatar
      selftests: txtimestamp: add flag for timestamp validation tolerance. · d3239425
      Jian Yang authored
      The txtimestamp selftest sets a fixed 500us tolerance. This value was
      arrived at experimentally. Some platforms have higher variances. Make
      this adjustable by adding the following flag:
      
      -t N: tolerance (usec) for timestamp validation.
      Signed-off-by: default avatarJian Yang <jianyang@google.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d3239425
    • David S. Miller's avatar
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next · 3c2d19cb
      David S. Miller authored
      Steffen Klassert says:
      
      ====================
      pull request (net-next): ipsec-next 2020-07-30
      
      Please note that I did the first time now --no-ff merges
      of my testing branch into the master branch to include
      the [PATCH 0/n] message of a patchset. Please let me
      know if this is desirable, or if I should do it any
      different.
      
      1) Introduce a oseq-may-wrap flag to disable anti-replay
         protection for manually distributed ICVs as suggested
         in RFC 4303. From Petr Vaněk.
      
      2) Patchset to fully support IPCOMP for vti4, vti6 and
         xfrm interfaces. From Xin Long.
      
      3) Switch from a linear list to a hash list for xfrm interface
         lookups. From Eyal Birger.
      
      4) Fixes to not register one xfrm(6)_tunnel object twice.
         From Xin Long.
      
      5) Fix two compile errors that were introduced with the
         IPCOMP support for vti and xfrm interfaces.
         Also from Xin Long.
      
      6) Make the policy hold queue work with VTI. This was
         forgotten when VTI was implemented.
      
      Please pull or let me know if there are problems.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3c2d19cb
  2. 29 Jul, 2020 31 commits