1. 15 Aug, 2012 1 commit
  2. 28 Oct, 2010 1 commit
    • Gerrit Renker's avatar
      dccp: Return-value convention of hc_tx_send_packet() · fe84f414
      Gerrit Renker authored
      
      
      This patch reorganises the return value convention of the CCID TX sending
      function, to permit more flexible schemes, as required by subsequent patches.
      
      Currently the convention is
       * values < 0     mean error,
       * a value == 0   means "send now", and
       * a value x > 0  means "send in x milliseconds".
      
      The patch provides symbolic constants and a function to interpret return values.
      
      In addition, it caps the maximum positive return value to 0xFFFF milliseconds,
      corresponding to 65.535 seconds.  This is possible since in CCID-3/4 the
      maximum possible inter-packet gap is fixed at t_mbi = 64 sec.
      
      Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fe84f414
  3. 11 Oct, 2010 1 commit
  4. 21 Sep, 2010 1 commit
    • Gerrit Renker's avatar
      dccp: Add packet type information to CCID-specific option parsing · 4874c131
      Gerrit Renker authored
      
      
      This
       1. adds packet type information to ccid_hc_{rx,tx}_parse_options(). This is
          necessary, since table 3 in RFC 4340, 5.8 leaves it to the CCIDs to state
          which options may (not) appear on what packet type.
      
       2. adds such a check for CCID-3's {Loss Event, Receive} Rate as specified in
          RFC 4340 8.3 ("Receive Rate options MUST NOT be sent on DCCP-Data packets")
          and 8.5 ("Loss Event Rate options MUST NOT be sent on DCCP-Data packets").
      
       3. removes an unused argument `idx' from ccid_hc_{rx,tx}_parse_options(). This
          is also no longer necessary, since the CCID-specific option-parsing routines
          are passed every single parameter of the type-length-value option encoding.
      
      Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
      4874c131
  5. 03 Feb, 2010 1 commit
    • Gerrit Renker's avatar
      dccp: fix bug in cache allocation · 8ed030dd
      Gerrit Renker authored
      This fixes a bug introduced in commit de4ef86c
      
      
      ("dccp: fix dccp rmmod when kernel configured to use slub", 17 Jan): the
      vsnprintf used sizeof(slab_name_fmt), which became truncated to 4 bytes, since
      slab_name_fmt is now a 4-byte pointer and no longer a 32-character array.
      
      This lead to error messages such as
       FATAL: Error inserting dccp: No buffer space available
      
       >> kernel: [ 1456.341501] kmem_cache_create: duplicate cache cci
      generated due to the truncation after the 3rd character.
      
      Fixed for the moment by introducing a symbolic constant. Tested to fix the bug.
      
      Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8ed030dd
  6. 19 Jan, 2010 1 commit
    • Neil Horman's avatar
      dccp: fix dccp rmmod when kernel configured to use slub · de4ef86c
      Neil Horman authored
      
      
      Hey all-
      	I was tinkering with dccp recently and noticed that I BUG halted the
      kernel when I rmmod-ed the dccp module.  The bug halt occured because the page
      that I passed to kfree failed the PageCompound and PageSlab test in the slub
      implementation of kfree.  I tracked the problem down to the following set of
      events:
      
      1) dccp, unlike all other uses of kmem_cache_create, allocates a string
      dynamically when registering a slab cache.  This allocated string is freed when
      the cache is destroyed.
      
      2) Normally, (1) is not an issue, but when Slub is in use, it is possible that
      caches are 'merged'.  This process causes multiple caches of simmilar
      configuration to use the same cache data structure.  When this happens, the new
      name of the cache is effectively dropped.
      
      3) (2) results in kmem_cache_name returning an ambigous value (i.e.
      ccid_kmem_cache_destroy, which uses this fuction to retrieve the name pointer
      for freeing), is no longer guaranteed that the string it assigned is what is
      returned.
      
      4) If such merge event occurs, ccid_kmem_cache_destroy frees the wrong pointer,
      which trips over the BUG in the slub implementation of kfree (since its likely
      not a slab allocation, but rather a pointer into the static string table
      section.
      
      So, what to do about this.  At first blush this is pretty clearly a leak in the
      information that slub owns, and as such a slub bug.  Unfortunately, theres no
      really good way to fix it, without exposing slub specific implementation details
      to the generic slab interface.  Also, even if we could fix this in slub cleanly,
      I think the RCU free option would force us to do lots of string duplication, not
      only in slub, but in every slab allocator.  As such, I'd like to propose this
      solution.  Basically, I just move the storage for the kmem cache name to the
      ccid_operations structure.  In so doing, we don't have to do the kstrdup or
      kfree when we allocate/free the various caches for dccp, and so we avoid the
      problem, by storing names with static memory, rather than heap, the way all
      other calls to kmem_cache_create do.
      
      I've tested this out myself here, and it solves the problem quite well.
      
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Acked-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      de4ef86c
  7. 04 Jan, 2009 2 commits
  8. 08 Dec, 2008 1 commit
  9. 23 Nov, 2008 1 commit
  10. 12 Nov, 2008 1 commit
    • Gerrit Renker's avatar
      dccp: Query supported CCIDs · d90ebcbf
      Gerrit Renker authored
      
      
      This provides a data structure to record which CCIDs are locally supported
      and three accessor functions:
       - a test function for internal use which is used to validate CCID requests
         made by the user;
       - a copy function so that the list can be used for feature-negotiation;   
       - documented getsockopt() support so that the user can query capabilities.
      
      The data structure is a table which is filled in at compile-time with the
      list of available CCIDs (which in turn depends on the Kconfig choices).
      
      Using the copy function for cloning the list of supported CCIDs is useful for
      feature negotiation, since the negotiation is now with the full list of available
      CCIDs (e.g. {2, 3}) instead of the default value {2}. This means negotiation 
      will not fail if the peer requests to use CCID3 instead of CCID2. 
      
      Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
      Acked-by: default avatarIan McDonald <ian.mcdonald@jandi.co.nz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d90ebcbf
  11. 09 Sep, 2008 1 commit
  12. 03 Sep, 2008 7 commits
    • Gerrit Renker's avatar
      dccp: Return-value convention of hc_tx_send_packet() · f4a66ca4
      Gerrit Renker authored
      
      
      This patch reorganises the return value convention of the CCID TX sending
      function, to permit more flexible schemes, as required by subsequent patches.
      
      Currently the convention is 
       * values < 0     mean error,
       * a value == 0   means "send now", and
       * a value x > 0  means "send in x milliseconds".
      
      The patch provides symbolic constants and a function to interpret return values.
      In addition, it caps the maximum positive return value to 0xFFFF milliseconds,
      corresponding to 65.535 seconds. 
      
      This is possible since in CCID-3 the maximum inter-packet gap is t_mbi = 64 sec.
      
      Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
      f4a66ca4
    • Gerrit Renker's avatar
      dccp: Unused argument in CCID tx function · c506d91d
      Gerrit Renker authored
      
      
      This removes the argument `more' from ccid_hc_tx_packet_sent, since it was
      nowhere used in the entire code.
      
      (Anecdotally, this argument was not even used in the original KAME code where
       the function originally came from; compare the variable moreToSend in the
       freebsd61-dccp-kame-28.08.2006.patch now maintained by Emmanuel Lochin.)
      
      Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
      c506d91d
    • Gerrit Renker's avatar
      dccp: Add packet type information to CCID-specific option parsing · 3306c781
      Gerrit Renker authored
      
      
      This patch ...
       1. adds packet type information to ccid_hc_{rx,tx}_parse_options(). This is 
          necessary, since table 3 in RFC 4340, 5.8 leaves it to the CCIDs to state
          which options may (not) appear on what packet type.
       
       2. adds such a check for CCID-3's {Loss Event, Receive} Rate as specified in
          RFC 4340 8.3 ("Receive Rate options MUST NOT be sent on DCCP-Data packets")
          and 8.5 ("Loss Event Rate options MUST NOT be sent on DCCP-Data packets").
      
       3. removes an unused argument `idx' from ccid_hc_{rx,tx}_parse_options(). This
          is also no longer necessary, since the CCID-specific option-parsing routines
          are passed every single parameter of the type-length-value option encoding.
      
      Also added documentation and made argument naming scheme consistent.
      
      Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
      3306c781
    • Gerrit Renker's avatar
      dccp: Auto-load (when supported) CCID plugins for negotiation · 09856c10
      Gerrit Renker authored
      
      
      This adds auto-loading of CCIDs (when module loading is enabled) 
      for the purpose of feature negotiation. 
      
      The problem with loading the CCIDs at the end of feature negotiation is
      that this would happen in software interrupt context. Besides, if the host
      advertises CCIDs during negotiation, it should have them ready to use, in
      case an agreeing peer wants to use it for the connection.
      
      Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
      Signed-off-by: default avatarIan McDonald <ian.mcdonald@jandi.co.nz>
      09856c10
    • Gerrit Renker's avatar
      dccp: Remove obsolete parts of the old CCID interface · 78673e24
      Gerrit Renker authored
      
      
      The TX/RX CCIDs of the minisock are now redundant: similar to the Ack Vector
      case, their value equals initially that of the sysctl, but at the end of
      feature negotiation may be something different.
      
      The old interface removed by this patch thus has been replaced by the newer
      interface to dynamically query the currently loaded CCIDs earlier in this
      patch set.
      
      Also removed the constructors for the TX CCID and the RX CCID, since the
      switch rx/non-rx is done by the handler in minisocks.c (and the handler is
      the only place in the code where CCIDs are loaded).
      
      Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
      Acked-by: default avatarIan McDonald <ian.mcdonald@jandi.co.nz>
      78673e24
    • Gerrit Renker's avatar
      dccp: API to query the current TX/RX CCID · c8041e26
      Gerrit Renker authored
      
      
      This provides function to query the current TX/RX CCID dynamically, without
      reliance on the minisock value, using dynamic information available in the
      currently loaded CCID module.
      
      This query function is then used to 
       (a) provide the getsockopt part for getting/setting CCIDs via sockopts;
       (b) replace the current test for "which CCID is in use" in probe.c.
      
      Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
      Acked-by: default avatarIan McDonald <ian.mcdonald@jandi.co.nz>
      c8041e26
    • Gerrit Renker's avatar
      dccp: Query supported CCIDs · 71bb4959
      Gerrit Renker authored
      
      
      This provides a data structure to record which CCIDs are locally supported
      and three accessor functions:
       - a test function for internal use which is used to validate CCID requests
         made by the user;
       - a copy function so that the list can be used for feature-negotiation;   
       - documented getsockopt() support so that the user can query capabilities.
      
      The data structure is a table which is filled in at compile-time with the
      list of available CCIDs (which in turn depends on the Kconfig choices).
      
      Using the copy function for cloning the list of supported CCIDs is useful for
      feature negotiation, since the negotiation is now with the full list of available
      CCIDs (e.g. {2, 3}) instead of the default value {2}. This means negotiation 
      will not fail if the peer requests to use CCID3 instead of CCID2. 
      
      Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
      Acked-by: default avatarIan McDonald <ian.mcdonald@jandi.co.nz>
      71bb4959
  13. 28 Jan, 2008 2 commits
  14. 11 Dec, 2006 1 commit
    • Gerrit Renker's avatar
      [DCCP] ccid: Deprecate ccid_hc_tx_insert_options · 65d6c2b4
      Gerrit Renker authored
      
      
       The function ccid3_hc_tx_insert_options only does a redundant no-op,
       as the operation
      
        DCCP_SKB_CB(skb)->dccpd_ccval = hctx->ccid3hctx_last_win_count;
      
       is already performed _unconditionally_ in ccid3_hc_tx_send_packet.
      
       Since there is further no current need for this function, it is removed
       entirely. Since furthermore, there is actually no present need for the
       entire interface function ccid_hc_tx_insert_options, it was decided to
       remove it also, to clean up the interface.
      
      Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@mandriva.com>
      65d6c2b4
  15. 07 Dec, 2006 1 commit
  16. 02 Dec, 2006 1 commit
    • Gerrit Renker's avatar
      [DCCP]: Use `unsigned' for packet lengths · 6b57c93d
      Gerrit Renker authored
      
      
      This patch implements a suggestion by Ian McDonald and
      
       1) Avoids tests against negative packet lengths by using unsigned int
          for packet payload lengths in the CCID send_packet()/packet_sent() routines
      
       2) As a consequence, it removes an now unnecessary test with regard to `len > 0'
          in ccid3_hc_tx_packet_sent: that condition is always true, since
            * negative packet lengths are avoided
            * ccid3_hc_tx_send_packet flags an error whenever the payload length is 0.
              As a consequence, ccid3_hc_tx_packet_sent is never called as all errors
              returned by ccid_hc_tx_send_packet are caught in dccp_write_xmit
      
       3) Removes the third argument of ccid_hc_tx_send_packet (the `len' parameter),
          since it is currently always set to skb->len. The code is updated with regard
          to this parameter change.
      
      Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
      Signed-off-by: default avatarIan McDonald <ian.mcdonald@jandi.co.nz>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@mandriva.com>
      6b57c93d
  17. 20 Mar, 2006 2 commits
  18. 03 Jan, 2006 1 commit
  19. 10 Oct, 2005 1 commit
  20. 18 Sep, 2005 1 commit
  21. 29 Aug, 2005 5 commits