Skip to content
Snippets Groups Projects
  1. May 17, 2024
    • Nilesh Patra's avatar
    • Tom Parkin's avatar
      Update changelog for upstream v0.1.8 · 2710b45e
      Tom Parkin authored
      2710b45e
    • Tom Parkin's avatar
      Update upstream source from tag 'upstream/0.1.8' · 0d7290d5
      Tom Parkin authored
      Update to upstream version '0.1.8'
      with Debian dir 9a5286ebd560e8bc8abeb8d91b19421265147dd1
      0d7290d5
    • Tom Parkin's avatar
    • Tom Parkin's avatar
    • Tom Parkin's avatar
      l2tp/msg: log and ignore data packets received over the control socket · 6404a134
      Tom Parkin authored
      When bringing up a session as a client, go-l2tp creates the dataplane
      for that session once the controlplane has fully established.
      
      The controlplane is considered to be fully established once go-l2tp's
      ICCN message has been acknowledged by the server by the rules of the
      L2TP reliable transport algorithm.
      
      Depending on the implementation of the server, and the vagaries of UDP
      transmission, it's possible that the control packet acknowledging the
      ICCN might arrive after the first dataplane frame.
      
      In this scenario, the Linux kernel doesn't know what to do with the
      first data frame, because go-l2tp hasn't yet created the dataplane for
      the session.  It defaults to passing the data frame up to userspace in
      the hopes userspace will be able to do something with it.
      
      As such, it's possible for go-l2tp's parsing code to see data frames.
      It will typically reject these, although with a rather confusing error
      message:
      
          level=error tunnel_name=t1 function=transport message="frame receive failed"
              error="malformed header: length 17024 exceeds buffer bounds of 30"
      
      This error stems from the fact that the Linux kernel doesn't set the
      length L2TP header field for data packets: that's perfectly legitimate,
      but it results in a header with the tunnel ID at the offset the length
      field would normally be for a control packet.
      
      As a result, go-l2tp parses the tunnel ID as the packet length.  Since
      tunnel IDs are often randomly generated it's likely that the tunnel ID
      as a numeric value will be greater than the length of the frame on the
      wire, and so go-l2tp will reject the frame early in the parsing process.
      
      This generally isn't harmful, since the logging on a "malformed header"
      is just informational: however it does confound debugging efforts.
      
      However, in the edge case that the tunnel ID was less than or equal to
      the length of the frame on the wire, go-l2tp wouldn't reject the frame
      and would go ahead and try to (and fail to) parse it as a control frame.
      This would almost certainly cause the tunnel to be torn down.
      
      To avoid these problems, go-l2tp can check the message type bit in the
      L2TP header prior to doing any further parsing.  That allows data frames
      to be dropped earlier in the process with explicit logging.
      
      ref: https://bbs.archlinux.org/viewtopic.php?pid=1970197#p1970197
      6404a134
    • Tom Parkin's avatar
      l2tp/tunnel: add FSM handling for SLI and WEN messages · 8550c3a9
      Tom Parkin authored
      We don't currently do anything useful with these messages, just log
      them (it's worth noting xl2tpd takes the same approach with SLI).
      
      Interestingly, while RFC2661 defines these control messages it doesn't
      call them out explicitly in the FSM tables, so it's not clear when they
      should be expected.
      
      However from the context it makes sense they'd be handled after the
      tunnel and session was established.
      
      For the time being, since we're just ignoring the messages, there's
      little point plumbing them through to the session, so this commit
      doesn't do that.
      
      Set-Link-Info might be sent by the LNS to the LAC to set PPP-negotiated
      options.
      
      RFC2661 states:
      
              These options can change at any time during the life
              of the call, thus the LAC MUST be able to update its internal
              call information and behavior on an active PPP session.
      
      In order to do this, go-l2tp would need some way to dynamically send
      updated ACCM information to pppd, which implies some kind of IPC between
      pppd and go-l2tp.
      
      WAN-Error-Notify shouldn't really be seen by go-l2tp currently since
      it's supposed to be sent by the LAC to the LNS.  However we might as
      well add minimal handling for it just in case.
      
      Fixes #6
      8550c3a9
    • Tom Parkin's avatar
      l2tp/msg: support L2TPv2 SLI and WEN messages · 5720acff
      Tom Parkin authored
      Add message specifications for the following L2TPv2 control messages:
      
       * WAN-Error-Notify (WEN) (RFC2661 section 6.13),
       * Set-Link-Info (SLI) (RFC2661 section 6.14).
      
      We need to at least recognise the messages, otherwise receipt of one of
      them from the peer will cause the tunnel instance to be torn down.
      5720acff
    • Tom Parkin's avatar
      l2tp/avp: don't reject L2TPv2 AVPs · 628104d9
      Tom Parkin authored
      There are some lesser-used L2TPv2 AVPs which go-l2tp doesn't currently
      do anything meaningful with.
      
      However, if we do receive one of these AVPs, we do want to be able to at
      least parse it: if not, we'll potentially end up tearing the tunnel down
      if the AVP is flagged as mandatory by the peer.
      
      Treat the following L2TPv2 AVPs as byte arrays:
      
       * Q.931 Cause Code (RFC2661 section 4.4.4)
       * Call Errors (RFC2661 section 4.4.6)
       * ACCM (RFC2661 section 4.4.6)
      
      All of these AVPs have some degree of internal structure which the
      parser can (and at some point should) learn to understand.
      
      For the time being, the avpDataTypeBytes type implies a minimum of
      processing by the parsing code, but allows the parser to handle the
      AVPs without falling over.
      
      While we're here, treat the draft-only Packet Proc Delay in the same
      way: it's unlikely we'll see it in the wild, but you never know.
      
      Finally, update the comment for the L2TPv3-only Pseudowire Caps AVP,
      which can stay as avpDataTypeUnimplemented since go-l2tp doesn't
      currently implement the v3 control plane.
      628104d9
  2. Feb 20, 2024
  3. Feb 19, 2024
  4. Oct 23, 2023
  5. Oct 17, 2023
  6. Oct 16, 2023
  7. Oct 13, 2023
Loading