1. 19 6月, 2005 10 次提交
    • A
      [NET] Rename open_request to request_sock · 60236fdd
      Arnaldo Carvalho de Melo 提交于
      Ok, this one just renames some stuff to have a better namespace and to
      dissassociate it from TCP:
      
      struct open_request  -> struct request_sock
      tcp_openreq_alloc    -> reqsk_alloc
      tcp_openreq_free     -> reqsk_free
      tcp_openreq_fastfree -> __reqsk_free
      
      With this most of the infrastructure closely resembles a struct
      sock methods subset.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      60236fdd
    • A
      [NET] Generalise TCP's struct open_request minisock infrastructure · 2e6599cb
      Arnaldo Carvalho de Melo 提交于
      Kept this first changeset minimal, without changing existing names to
      ease peer review.
      
      Basicaly tcp_openreq_alloc now receives the or_calltable, that in turn
      has two new members:
      
      ->slab, that replaces tcp_openreq_cachep
      ->obj_size, to inform the size of the openreq descendant for
        a specific protocol
      
      The protocol specific fields in struct open_request were moved to a
      class hierarchy, with the things that are common to all connection
      oriented PF_INET protocols in struct inet_request_sock, the TCP ones
      in tcp_request_sock, that is an inet_request_sock, that is an
      open_request.
      
      I.e. this uses the same approach used for the struct sock class
      hierarchy, with sk_prot indicating if the protocol wants to use the
      open_request infrastructure by filling in sk_prot->rsk_prot with an
      or_calltable.
      
      Results? Performance is improved and TCP v4 now uses only 64 bytes per
      open request minisock, down from 96 without this patch :-)
      
      Next changeset will rename some of the structs, fields and functions
      mentioned above, struct or_calltable is way unclear, better name it
      struct request_sock_ops, s/struct open_request/struct request_sock/g,
      etc.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e6599cb
    • J
      [IPSEC] Use NLMSG_LENGTH in xfrm_exp_state_notify · ee57eef9
      Jamal Hadi Salim 提交于
      Small fixup to use netlink macros instead of hardcoding.
      Signed-off-by: NJamal Hadi Salim <hadi@cyberus.ca>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ee57eef9
    • P
      [IPSEC] Fix xfrm_state leaks in error path · 7d6dfe1f
      Patrick McHardy 提交于
      Herbert Xu wrote:
      > @@ -1254,6 +1326,7 @@ static int pfkey_add(struct sock *sk, st
      >       if (IS_ERR(x))
      >               return PTR_ERR(x);
      >
      > +     xfrm_state_hold(x);
      
      This introduces a leak when xfrm_state_add()/xfrm_state_update()
      fail. We hold two references (one from xfrm_state_alloc(), one
      from xfrm_state_hold()), but only drop one. We need to take the
      reference because the reference from xfrm_state_alloc() can
      be dropped by __xfrm_state_delete(), so the fix is to drop both
      references on error. Same problem in xfrm_user.c.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7d6dfe1f
    • H
      [IPSEC] Use XFRM_MSG_* instead of XFRM_SAP_* · f60f6b8f
      Herbert Xu 提交于
      This patch removes XFRM_SAP_* and converts them over to XFRM_MSG_*.
      The netlink interface is meant to map directly onto the underlying
      xfrm subsystem.  Therefore rather than using a new independent
      representation for the events we can simply use the existing ones
      from xfrm_user.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      f60f6b8f
    • H
      [IPSEC] Set byid for km_event in xfrm_get_policy · e7443892
      Herbert Xu 提交于
      This patch fixes policy deletion in xfrm_user so that it sets
      km_event.data.byid.  This puts xfrm_user on par with what af_key
      does in this case.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      e7443892
    • H
      [IPSEC] Turn km_event.data into a union · bf08867f
      Herbert Xu 提交于
      This patch turns km_event.data into a union.  This makes code that
      uses it clearer.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      bf08867f
    • H
      [IPSEC] Fix xfrm to pfkey SA state conversion · 4f09f0bb
      Herbert Xu 提交于
      This patch adjusts the SA state conversion in af_key such that
      XFRM_STATE_ERROR/XFRM_STATE_DEAD will be converted to SADB_STATE_DEAD
      instead of SADB_STATE_DYING.
      
      According to RFC 2367, SADB_STATE_DYING SAs can be turned into
      mature ones through updating their lifetime settings.  Since SAs
      which are in the states XFRM_STATE_ERROR/XFRM_STATE_DEAD cannot
      be resurrected, this value is unsuitable.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      4f09f0bb
    • H
      [IPSEC] Kill spurious hard expire messages · 4666faab
      Herbert Xu 提交于
      This patch ensures that the hard state/policy expire notifications are
      only sent when the state/policy is successfully removed from their
      respective tables.
      
      As it is, it's possible for a state/policy to both expire through
      reaching a hard limit, as well as being deleted by the user.
      
      Note that this behaviour isn't actually forbidden by RFC 2367.
      However, it is a quality of implementation issue.
      
      As an added bonus, the restructuring in this patch will help
      eventually in moving the expire notifications from softirq
      context into process context, thus improving their reliability.
      
      One important side-effect from this change is that SAs reaching
      their hard byte/packet limits are now deleted immediately, just
      like SAs that have reached their hard time limits.
      
      Previously they were announced immediately but only deleted after
      30 seconds.
      
      This is bad because it prevents the system from issuing an ACQUIRE
      command until the existing state was deleted by the user or expires
      after the time is up.
      
      In the scenario where the expire notification was lost this introduces
      a 30 second delay into the system for no good reason.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      4666faab
    • J
      [IPSEC] Add complete xfrm event notification · 26b15dad
      Jamal Hadi Salim 提交于
      Heres the final patch.
      What this patch provides
      
      - netlink xfrm events
      - ability to have events generated by netlink propagated to pfkey
        and vice versa.
      - fixes the acquire lets-be-happy-with-one-success issue
      Signed-off-by: NJamal Hadi Salim <hadi@cyberus.ca>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      26b15dad
  2. 16 6月, 2005 1 次提交
  3. 14 6月, 2005 12 次提交
  4. 09 6月, 2005 7 次提交
  5. 07 6月, 2005 1 次提交
  6. 03 6月, 2005 2 次提交
  7. 02 6月, 2005 1 次提交
  8. 01 6月, 2005 4 次提交
  9. 31 5月, 2005 2 次提交
    • H
      [IPV4]: Fix BUG() in 2.6.x, udp_poll(), fragments + CONFIG_HIGHMEM · 208d8984
      Herbert Xu 提交于
      Steven Hand <Steven.Hand@cl.cam.ac.uk> wrote:
      > 
      > Reconstructed forward trace: 
      > 
      >   net/ipv4/udp.c:1334   spin_lock_irq() 
      >   net/ipv4/udp.c:1336   udp_checksum_complete() 
      > net/core/skbuff.c:1069   skb_shinfo(skb)->nr_frags > 1
      > net/core/skbuff.c:1086   kunmap_skb_frag()
      > net/core/skbuff.h:1087   local_bh_enable()
      > kernel/softirq.c:0140   WARN_ON(irqs_disabled());
      
      The receive queue lock is never taken in IRQs (and should never be) so
      we can simply substitute bh for irq.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      208d8984
    • H
      [NETFILTER]: Fix deadlock with ip_queue and tcp local input path. · 9bb7bc94
      Harald Welte 提交于
      When we have ip_queue being used from LOCAL_IN, then we end up with a
      situation where the verdicts coming back from userspace traverse the TCP
      input path from syscall context.  While this seems to work most of the
      time, there's an ugly deadlock:
      
      syscall context is interrupted by the timer interrupt.  When the timer
      interrupt leaves, the timer softirq get's scheduled and calls
      tcp_delack_timer() and alike.  They themselves do bh_lock_sock(sk),
      which is already held from somewhere else -> boom.
      
      I've now tested the suggested solution by Patrick McHardy and Herbert Xu to
      simply use local_bh_{en,dis}able().
      Signed-off-by: NHarald Welte <laforge@netfilter.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9bb7bc94