1. 30 4月, 2014 1 次提交
  2. 29 4月, 2014 5 次提交
  3. 24 4月, 2014 1 次提交
  4. 21 4月, 2014 2 次提交
  5. 14 4月, 2014 2 次提交
  6. 11 4月, 2014 22 次提交
    • D
      ipoe: early allocate interface for shared vlans (prevents different values of... · 33bdf407
      Dmitry Kozlov 提交于
      ipoe: early allocate interface for shared vlans (prevents different values of NAS-Port in Access-Request and Account-Request)
      Signed-off-by: NDmitry Kozlov <xeb@mail.ru>
      33bdf407
    • D
    • D
      net-snmp: run snmp in "special" thread · bf534029
      Dmitry Kozlov 提交于
      NET-SNMP is built on top of stale file descriptor multiplexing mechanism (select)
      which prevents to use descriptors with number >= 1024.
      Due to accel-ppp uses a lots of descriptors NET-SNMP easy overflows this limit and fails
      and even may crash whole accel-ppp process.
      This patch runs snmp in special thread which does not share file descritor table
      with main process, so it can use less descriptors and live in __FD_SETSIZE limit.
      Signed-off-by: NDmitry Kozlov <xeb@mail.ru>
      bf534029
    • G
      l2tp: don't disconnect immediately when receiving StopCCN · 918f808e
      Guillaume Nault 提交于
      Wait for a full retransmission cycle after reception of a StopCCN.
      Introduce STATE_FIN_WAIT to identify tunnels which have received a
      StopCCN but are waiting for the disconnection timer to expire.
      
      A tunnel can go from STATE_FIN (i.e. StopCCN has been sent, waiting for
      acknowledgement) to STATE_FIN_WAIT (i.e. StopCCN has been received,
      waiting for full retransmission cycle), but not the other way around.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      918f808e
    • G
      l2tp: improve configuration of retransmission options · e2de83e8
      Guillaume Nault 提交于
        * Set default retransmission timeout to 1 second. Since we now have
          exponential backoff, we can afford a smaller value.
      
        * Add the rtimeout-cap option to set the maximum value the
          retransmission timer has to respect during exponential backoff.
      
        * Store the maximun number of retransmissions in tunnel's structure
          (like other retransmission parameters).
      
        * Describe all these changes in man page and reset them to their
          default values if they're removed from configuration file before a
          reload.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      e2de83e8
    • G
      l2tp: implement exponential backoff (retransmit) · 2e442ae5
      Guillaume Nault 提交于
      Rework the l2tp_rtimeout() callback, so that time between
      retransmissions expands exponentially. This allows for faster
      retransmissions without without overwhelming the peer.
      
      A cap is set on the maximum retransmission time. For now it is set to
      16 seconds.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      2e442ae5
    • G
      l2tp: allow CDN reception with no Session ID · 7937f571
      Guillaume Nault 提交于
      If a peer needs to disconnect a session for which it didn't receive
      any reply, it sends a CDN with no Session ID. In this case, the
      Assigned Session ID AVP is the only data that can be used to find out
      which session has to be closed. Though it isn't supported for now,
      let's accept and ack these messages. Session will be deleted on our
      side thanks to the establishment timer.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      7937f571
    • G
      l2tp: configure receive window in accel-ppp.conf · 19cff977
      Guillaume Nault 提交于
      Add the recv-window option in accel-ppp.conf.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      19cff977
    • G
      l2tp: implement local receive window · 6677ca65
      Guillaume Nault 提交于
      Add a fixed length receive queue to tunnels and adverdise its length to
      the peer using the Receive Window Size AVP.
      
      Incoming message handling is modified as follow:
        -Read as much messages as possible and store them in the receive queue.
         Messages are stored in order, based on their sequence number. Messages
         not fitting into the queue are discarded (doesn't happen if peer
         respects our Receive Window AVP). This is the job of the new
         l2tp_tunnel_store_msg() function. It also automatically finds out if
         there are new messages to acknowledge.
      
        -Once all incoming messages have been read, free acknowledged packets
         from retransmission queue (based on the highest received
         acknowledgement number).
      
        -Then process messages in the receive queue. This is done by
         l2tp_tunnel_reply().  Each packet is processed by
         l2tp_{tunnel,session}_recv() (or dropped in some particular cases).
         The send queue is then pushed. If there's no message in the send
         queue and an acknowledgement is necessary, a ZLB is sent instead.
      
        -Finally, detect if the peer has acknowledged a StopCCN. There are
         three components to this test:
           -Have we tried to send a StopCCN? Check with tunnel's state.
           -Has the StopCCN been pushed on the network? Check with tunnel's
            send queue.
           -Has the peer acknowledged the StopCCN? Check with tunnel's
            retransmission queue.
      
      For now, l2tp_tunnel_store_msg() doesn't perform fast retransmissions.
      So l2tp_retransmit() is removed.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      6677ca65
    • G
      l2tp: rework error handling in l2tp_tunnel_alloc · 63500557
      Guillaume Nault 提交于
      Use stacked error labels for better extensibility.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      63500557
    • G
      l2tp: don't initiate new sessions when sending window is full · 2b911b95
      Guillaume Nault 提交于
      Refuse to create new sessions when the local send queue is bigger than
      the peer's receive window (i.e. when there are already more outstanding
      messages than what the peer can currently accept). Only sessions
      initiated locally are affected, session requests from the peer are
      still handled normally.
      
      This avoids adding useless presure on the sending window when many
      sessions are created locally. If sessions were created, they'd add
      many ICRQ or OCRQ messages in the send queue and we'd have to wait for
      all these messages to be sent before being able to reply to messages
      from the peer.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      2b911b95
    • G
      l2tp: respect peer's receive window · 4a16913a
      Guillaume Nault 提交于
      Store the Receive Window Size AVP sent by peer and respect it when
      sending messages. That is, stop sending messages from send queue once
      the number of unacknowledged messages is higher than peer's receive
      window.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      4a16913a
    • G
      l2tp: drop tunnel/session messages from send queue upon disconnection · 634c92cf
      Guillaume Nault 提交于
      Add a per session send queue. Messages sent by a session are added to
      both tunnel and session queues. This allows sessions to remove their
      unsent messages from tunnel's send queue before they disconnect.
      
      The same approach is used for tunnels. Before disconnecting, they clear
      their send queue to avoid sending useless messages.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      634c92cf
    • G
      l2tp: send ZLB messages automatically · 221f2f9a
      Guillaume Nault 提交于
      Modify return value of l2tp_tunnel_push_sendqueue() to inform the
      caller if a message has been sent or if the queue was empty. This
      information, let l2tp_conn_read() automatically acknowledge
      received messages using a ZLB when there's no response to send.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      221f2f9a
    • G
      l2tp: ignore l2tp_{tunnel, session}_send() return values · 9bcd65d1
      Guillaume Nault 提交于
      Stop checking for l2tp_{tunnel,session}_send() return values.
      These functions now always succeed, unless the session or tunnel is
      closing (in which case packet is automatically dropped and caller
      doesn't need to take any special action).
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      9bcd65d1
    • G
      l2tp: separate send and retransmission queues · f0f5c28e
      Guillaume Nault 提交于
      Don't send messages immediately, store them in conn->send_queue
      instead, so we have control over how many and when messages are
      sent on the network. Once a message is sent, it's removed from
      the send queue and added to the retransmission queue.
      
      Retransmission queue is automatically updated based on acknowledgements
      received from peer.
      
      For now, packets in the send queue are pushed on the network after
      each incoming packet processing. So functions called by l2tp_conn_read()
      don't have to call l2tp_tunnel_push_sendqueue().
      Other functions (e.g. triton callbacks) have to manually push packets
      out of the send queue.
      The same applies for disconnection. The l2tp_tunnel_disconnect_push()
      and l2tp_session_disconnect_push() functions have been defined for use
      in functions that don't call l2tp_tunnel_push_sendqueue() automatically.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      f0f5c28e
    • G
      l2tp: use separate function for handling tunnel specific messages · c924d549
      Guillaume Nault 提交于
      Remove message type switch from l2tp_conn_read(). Define
      l2tp_tunnel_recv() instead to handle tunnel specific messages.
      The Session ID field in L2TP control messages is used to determine if
      packet is tunnel or session oriented.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      c924d549
    • G
      l2tp: automatically delete tunnel if disconnection fails · 250167af
      Guillaume Nault 提交于
      Let l2tp_tunnel_disconnect() delete the tunnel when an error occurs.
      Return an int to indicate if conn has been deleted.
      
      Most callers are compatible with this new behaviour, either because
      they never use the tunnel after disconnection or because they hold
      a reference on the tunnel.
      
      A few callers need to be adapted though:
        -l2tp_conn_close() calls l2tp_tunnel_disconnect() to properly inform
         the peer of tunnel disconnection. But it also deletes the tunnel
         immediately, no matter if StopCCN message was sent or not. Since
         l2tp_conn_close() doesn't hold a reference on the tunnel, care must
         be taken not to access the tunnel if it was deleted by
         l2tp_tunnel_disconnect().
         Since immediate deletion isn't required, the l2tp_tunnel_free() call
         is simply removed. The normal disconnection process is now followed,
         with detection and retransmission of lost messages, acknowledgment
         handling, etc.
      
        -situation is similar for l2tp_tunnel_timeout() and handled in the
         same way.
      
      This patch also deletes tunnel's sessions, as well as the establishment
      and hello timers. These are of no use once the tunnel enters the
      disconnection process.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      250167af
    • G
      l2tp: delete tunnel in l2tp_recv_StopCCN() · 3448534c
      Guillaume Nault 提交于
      Now that l2tp_tunnel_free() can be called directly inside the main
      reception loop, let l2tp_recv_StopCCN() delete the tunnel itself.
      This avoids special handling in l2tp_conn_read().
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      3448534c
    • G
      l2tp: allow tunnel deletion in main reception loop · f2c1387d
      Guillaume Nault 提交于
      Let functions launched by l2tp_conn_read() delete the tunnel. This is
      done by taking a reference on conn to ensure it'll remain a valid
      tunnel, even after calling l2tp_tunnel_free(conn).
      
      l2tp_conn_read() now detects if conn got deleted, so that we know if
      the tunnel still holds a reference to itself. If it doesn't,
      tunnel_put() may free the tunnel and thus the triton handler we're
      running from. So we have to return -1 in this case.
      
      l2tp_tunnel_free() also needs to be modified: it can't safely close
      conn->hnd.fd anymore. Since l2tp_conn_read() relies on conn->hnd.fd
      being a valid file descriptor, closing it inside the reception loop
      would break this assumption in next iteration.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      f2c1387d
    • G
      l2tp: don't free tunnel immediately upon message handling errors · 411c4f94
      Guillaume Nault 提交于
      Upon failure, l2tp_recv_SCCRP() and l2tp_recv_SCCCN() disconnect their
      tunnel, which is then immediately deleted by l2tp_conn_read(). Deleting
      the tunnel isn't necessary at this stage and prevents retransmission of
      the disconnection message if it gets lost. Same applies to unknown
      message types with M bit set.
      
      This path avoids immediate tunnel deletion, thus allowing the
      disconnection process to handle acknowledgments from peer and to
      retransmit messages if necessary.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      411c4f94
    • G
      triton: implement list_first_entry() · ba47f761
      Guillaume Nault 提交于
        * Add list_first_entry() to list.h
        * Declare parameter of list_empty() as const
      
      Both changes are already included in Linux kernel sources.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      ba47f761
  7. 01 4月, 2014 7 次提交