1. 09 7月, 2016 2 次提交
  2. 04 7月, 2016 1 次提交
  3. 25 6月, 2016 2 次提交
  4. 09 6月, 2016 2 次提交
  5. 08 6月, 2016 2 次提交
  6. 02 6月, 2016 4 次提交
  7. 31 5月, 2016 2 次提交
  8. 14 5月, 2016 1 次提交
  9. 11 5月, 2016 6 次提交
    • G
      iprange: warn before disabling module due to /0 network with non-null IP · d682a0aa
      Guillaume Nault 提交于
      Using a /0 prefix on an IP different from 0.0.0.0 is valid, but might
      be a configuration mistake. Log warning message in this case so that
      user can easily troubleshoot it.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      d682a0aa
    • G
      iprange: replace UINT32_MAX by INADDR_BROADCAST · ff2000c2
      Guillaume Nault 提交于
      This is equivalent, but INADDR_BROADCAST is more descriptive.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      ff2000c2
    • G
      iprange: don't warn about empty iprange config if no modules depend on it · f21ca06b
      Guillaume Nault 提交于
      Move warning messages to PPTP and L2TP modules. No other module
      actually uses iprange, so it's perfectly valid to disable it, or at
      least to not configure any range, when PPTP and L2TP aren't used.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      f21ca06b
    • G
      iprange: implement config reload · 448d99b3
      Guillaume Nault 提交于
      Protect conf_disable and client_ranges with a mutex.
      Instead of directly setting conf_disable, load_ranges() now returns
      a disable flag. The caller is in charge of propagating its value
      in conf_disable.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      448d99b3
    • G
      triton: implement list_replace*() · c6c1d763
      Guillaume Nault 提交于
      Add list_replace() and list_replace_init(), as defined in Linux kernel
      sources.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      c6c1d763
    • G
      iprange: rework ip range parsing functions · 7ae77124
      Guillaume Nault 提交于
      The previous parsing functions had a few problems:
      
        * They did accept negative numbers in addresses (e.g. 192.0.2.-5).
      
        * They relied on C undefined behaviour for detecting /0 prefix
          length: "mask = htonl(~((1 << (32 - m)) - 1)" was wrong for m = 0,
          because that resulted in a left shift of 32 bits, on a 32 bit wide
          value (the right operand of a bitwise shift operator must be
          strictly smaller than the width of the promoted left operand).
      
        * They misinterpreted /32 prefixes as disable requests. In fact, due
          to the undefined behaviour described above, /0 and /32 prefix
          lengths were represented in the same way by parse1(), that is, with
          an iprange_t structure where ->begin == ->end. Therefore
          load_ranges() had no way to distinguish between them and did
          disable the module in both cases.
      
      This patch fixes these issues and brings the following improvements:
      
        * It uses getaddrinfo() to parse IP addresses, so it accept (almost)
          all IPv4 representations and is more easily extensible to IPv6 in
          the future.
      
        * It warns when the IP address used in CIDR notation is not the first
          address in the range (e.g. the first address of 192.0.2.1/24 is
          192.0.2.0, not 192.0.2.1).
      
        * It doesn't _exit() on parsing failures, thus making the functions
          usable in an EV_CONFIG_RELOAD handler.
      
      While there, the unfinished tunnel_ranges code, which was already
      commented, has been removed.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      7ae77124
  10. 02 5月, 2016 1 次提交
  11. 01 5月, 2016 2 次提交
  12. 30 4月, 2016 1 次提交
  13. 28 4月, 2016 3 次提交
    • G
      cli: flush pending data before disconnecting · 20e1eff0
      Guillaume Nault 提交于
      The telnet and tcp servers disconnect as soon as they receive the
      'exit' command or see a disconnection from the client. In this case,
      all data queued for transmission are lost. This can lead to truncated
      output when big amount of data is being sent.
      
      For example, on a moderately loaded server with a few thouthands
      connections, the output of the 'accel-cmd show sessions' command can be
      truncated.
      The problem is that accel-cmd sends the 'show sessions' command,
      followed by 'exit'. It does so because it has to stop running once all
      data has been received from the server. But it never knows whether more
      data are going to arrive. Disconnection must then come from the server,
      hence the use of 'exit' (although the same effect could be achieved
      with shutdown(SHUT_WR)).
      
      The telnet and tcp modules behave very similarly and are modified in
      the same way:
      
        * For a soft disconnection, cln_read() doesn't call disconnect()
          anymore if there are data queued for transmission. Instead it
          sets the 'disconnect' flag and stops listening to its peer (no
          need to process further messages).
      
        * cln_write() checks the 'disconnect' flag once it has sent all
          pending data and actually performs the disconnection if necessary.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      20e1eff0
    • G
      cli: fix data output miss-ordering · 72b21d05
      Guillaume Nault 提交于
      In tcp and telnet backends, the first buffer been queued is directly
      pointed to by cln->xmit_buf. It's not added to cln->xmit_queue.
      Therefore testing if ->xmit_queue is empty doesn't reliably tells
      if data has already been queued.
      
      We should test if ->xmit_buf is non-NULL instead. This is reliable
      because ->xmit_buf is re-filled with the first buffer from ->xmit_queue
      after every successful write().
      
      Failure to properly check if data has already been queued can lead to
      message miss-ordering because cli_client_send() or telnet_send() will
      try to directly write() their input buffer, effectively bypassing the
      one previously queued up in ->xmit_buf.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      72b21d05
    • G
      cli: fix partial line duplication and truncation · 16449c4f
      Guillaume Nault 提交于
      When queueing output data for later write(), the 'n' first bytes of the
      buffer have already been sent (we have n > 0 if EAGAIN was returned
      after some other write() calls succeeded). Therefore, we need to skip
      these bytes when initialising the buffer to be queued.
      The size passed to memcpy() did already take that space into account.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      16449c4f
  14. 17 4月, 2016 1 次提交
  15. 15 4月, 2016 1 次提交
  16. 13 4月, 2016 3 次提交
  17. 12 4月, 2016 3 次提交
  18. 10 4月, 2016 2 次提交
  19. 07 4月, 2016 1 次提交