27 Nov, 2011

1 commit

  • When using l2tp over ipsec, the tunnel will hang when rekeying
    occurs. Reason is that the transformer bundle attached to the dst entry
    is now in STATE_DEAD and thus xfrm_output_one() drops all packets
    (XfrmOutStateExpired increases).

    Fix this by calling __sk_dst_check (which drops the stale dst
    if xfrm dst->check callback finds that the bundle is no longer valid).

    Cc: James Chapman
    Signed-off-by: Florian Westphal
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Florian Westphal
     

09 Nov, 2011

1 commit


04 Nov, 2011

1 commit

  • Misha Labjuk reported panics occurring in l2tp_recv_dequeue()

    If we release reorder_q.lock, we must not keep a dangling pointer (tmp),
    since another thread could manipulate reorder_q.

    Instead we must restart the scan at beginning of list.

    Reported-by: Misha Labjuk
    Tested-by: Misha Labjuk
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

19 Oct, 2011

1 commit


27 Jul, 2011

1 commit

  • This allows us to move duplicated code in
    (atomic_inc_not_zero() for now) to

    Signed-off-by: Arun Sharma
    Reviewed-by: Eric Dumazet
    Cc: Ingo Molnar
    Cc: David Miller
    Cc: Eric Dumazet
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun Sharma
     

13 May, 2011

1 commit

  • While trying to remove useless synchronize_rcu() calls, I found l2tp is
    indeed incorrectly using two of such calls, but also bumps tunnel
    refcount after list insertion.

    tunnel refcount must be incremented before being made publically visible
    by rcu readers.

    This fix can be applied to 2.6.35+ and might need a backport for older
    kernels, since things were shuffled in commit fd558d186df2c
    (l2tp: Split pppol2tp patch into separate l2tp and ppp parts)

    Signed-off-by: Eric Dumazet
    CC: Paul E. McKenney
    CC: James Chapman
    Reviewed-by: Paul E. McKenney
    Signed-off-by: David S. Miller

    Eric Dumazet
     

09 May, 2011

2 commits

  • This allows us to acquire the exact route keying information from the
    protocol, however that might be managed.

    It handles all of the possibilities, from the simplest case of storing
    the key in inet->cork.fl to the more complex setup SCTP has where
    individual transports determine the flow.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • l2tp_xmit_skb() must take the socket lock. It makes use of ip_queue_xmit()
    which expects to execute in a socket atomic context.

    Since we execute this function in software interrupts, we cannot use the
    usual lock_sock()/release_sock() sequence, instead we have to use
    bh_lock_sock() and see if a user has the socket locked, and if so drop
    the packet.

    Signed-off-by: David S. Miller

    David S. Miller
     

25 Oct, 2010

2 commits

  • Causes these build failures on PowerPC:

    net/l2tp/l2tp_core.c:1228: error: __ksymtab_l2tp_tunnel_closeall causes a section type conflict
    net/l2tp/l2tp_core.c:1228: error: __ksymtab_l2tp_tunnel_closeall causes a section type conflict
    net/l2tp/l2tp_core.c:1006: error: __ksymtab_l2tp_xmit_core causes a section type conflict
    net/l2tp/l2tp_core.c:1006: error: __ksymtab_l2tp_xmit_core causes a section type conflict
    net/l2tp/l2tp_core.c:847: error: __ksymtab_l2tp_udp_recv_core causes a section type conflict
    net/l2tp/l2tp_core.c:847: error: __ksymtab_l2tp_udp_recv_core causes a section type conflict

    Signed-off-by: Stephen Rothwell
    Signed-off-by: David S. Miller

    Stephen Rothwell
     
  • Also moved the refcound inlines from l2tp_core.h to l2tp_core.c
    since only used in that one file.

    Signed-off-by: Stephen Hemminger
    Acked-by: James Chapman
    Signed-off-by: David S. Miller

    stephen hemminger
     

24 Apr, 2010

1 commit

  • Since .size is set properly in "struct pernet_operations l2tp_net_ops",
    allocating space for "struct l2tp_net" by hand is not correct, even causes
    memory leakage.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     

16 Apr, 2010

1 commit

  • As Herbert Xu said: we should be able to simply replace ipfragok
    with skb->local_df. commit f88037(sctp: Drop ipfargok in sctp_xmit function)
    has droped ipfragok and set local_df value properly.

    The patch kills the ipfragok parameter of .queue_xmit().

    Signed-off-by: Shan Wei
    Signed-off-by: David S. Miller

    Shan Wei
     

04 Apr, 2010

7 commits

  • Followup to commit 789a4a2c
    (l2tp: Add support for static unmanaged L2TPv3 tunnels)

    One missing init in l2tp_tunnel_sock_create() could access random kernel
    memory, and a bit field should be unsigned.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • This patch adds support for static (unmanaged) L2TPv3 tunnels, where
    the tunnel socket is created by the kernel rather than being created
    by userspace. This means L2TP tunnels and sessions can be created
    manually, without needing an L2TP control protocol implemented in
    userspace. This might be useful where the user wants a simple ethernet
    over IP tunnel.

    A patch to iproute2 adds a new command set under "ip l2tp" to make use
    of this feature. This will be submitted separately.

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman
     
  • Reader/write locks are discouraged because they are slower than spin
    locks. So this patch converts the rwlocks used in the per_net structs
    to rcu.

    Signed-off-by: James Chapman
    Signed-off-by: David S. Miller

    James Chapman
     
  • In L2TPv3, we need to create/delete/modify/query L2TP tunnel and
    session contexts. The number of parameters is significant. So let's
    use netlink. Userspace uses this API to control L2TP tunnel/session
    contexts in the kernel.

    The previous pppol2tp driver was managed using [gs]etsockopt(). This
    API is retained for backwards compatibility. Unlike L2TPv2 which
    carries only PPP frames, L2TPv3 can carry raw ethernet frames or other
    frame types and these do not always have an associated socket
    family. Therefore, we need a way to use L2TP sessions that doesn't
    require a socket type for each supported frame type. Hence netlink is
    used.

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman
     
  • This patch adds a new L2TPIP socket family and modifies the core to
    handle the case where there is no UDP header in the L2TP
    packet. L2TP/IP uses IP protocol 115. Since L2TP/UDP and L2TP/IP
    packets differ in layout, the datapath packet handling code needs
    changes too. Userspace uses an L2TPIP socket instead of a UDP socket
    when IP encapsulation is required.

    We can't use raw sockets for this because the semantics of raw sockets
    don't lend themselves to the socket-per-tunnel model - we need to

    Signed-off-by: David S. Miller

    James Chapman
     
  • The L2TPv3 protocol changes the layout of the L2TP packet
    header. Tunnel and session ids change from 16-bit to 32-bit values,
    data sequence numbers change from 16-bit to 24-bit values and PPP-specific
    fields are moved into protocol-specific subheaders.

    Although this patch introduces L2TPv3 protocol support, there are no
    userspace interfaces to create L2TPv3 sessions yet.

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman
     
  • This patch splits the pppol2tp driver into separate L2TP and PPP parts
    to prepare for L2TPv3 support. In L2TPv3, protocols other than PPP can
    be carried, so this split creates a common L2TP core that will handle
    the common L2TP bits which protocol support modules such as PPP will
    use.

    Note that the existing pppol2tp module is split into l2tp_core and
    l2tp_ppp by this change.

    There are no feature changes here. Internally, however, there are
    significant changes, mostly to handle the separation of PPP-specific
    data from the L2TP session and to provide hooks in the core for
    modules like PPP to access.

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman