27 Jul, 2008

1 commit

  • net/ipv4/ipcomp.c: In function ‘ipcomp4_init_state’:
    net/ipv4/ipcomp.c:109: warning: unused variable ‘calg_desc’
    net/ipv4/ipcomp.c:108: warning: unused variable ‘ipcd’
    net/ipv4/ipcomp.c:107: warning: ‘err’ may be used uninitialized in this function
    net/ipv6/ipcomp6.c: In function ‘ipcomp6_init_state’:
    net/ipv6/ipcomp6.c:139: warning: unused variable ‘calg_desc’
    net/ipv6/ipcomp6.c:138: warning: unused variable ‘ipcd’
    net/ipv6/ipcomp6.c:137: warning: ‘err’ may be used uninitialized in this function

    Signed-off-by: David S. Miller

    David S. Miller
     

25 Jul, 2008

1 commit


19 Apr, 2008

1 commit


29 Feb, 2008

1 commit

  • Because we use shared tfm objects in order to conserve memory,
    (each tfm requires 128K of vmalloc memory), BH needs to be turned
    off on output as that can occur in process context.

    Previously this was done implicitly by the xfrm output code.
    That was lost when it became lockless. So we need to add the
    BH disabling to IPComp directly.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

01 Feb, 2008

2 commits


29 Jan, 2008

1 commit

  • While BEET can theoretically work with IPComp the current code can't
    do that because it tries to construct a BEET mode tunnel type which
    doesn't (and cannot) exist. In fact as it is it won't even attach a
    tunnel object at all for BEET which is bogus.

    To support this fully we'd also need to change the policy checks on
    input to recognise a plain tunnel as a legal variant of an optional
    BEET transform.

    This patch simply fails such constructions for now.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

07 Nov, 2007

1 commit


02 Nov, 2007

1 commit


18 Oct, 2007

1 commit

  • Combining RO and AH/ESP/IPCOMP does not make sense. So this patch adds a
    check in the state initialisation function to prevent this.

    This allows us to safely remove the mode input function of RO since it
    can never be called anymore. Indeed, if somehow it does get called we'll
    know about it through an OOPS instead of it slipping past silently.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

11 Oct, 2007

5 commits

  • This patch moves the setting of the IP length and checksum fields out of
    the transforms and into the xfrmX_output functions. This would help future
    efforts in merging the transforms themselves.

    It also adds an optimisation to ipcomp due to the fact that the transport
    offset is guaranteed to be zero.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • This patch removes the duplicate ipv6_{auth,esp,comp}_hdr structures since
    they're identical to the IPv4 versions. Duplicating them would only create
    problems for ourselves later when we need to add things like extended
    sequence numbers.

    I've also added transport header type conversion headers for these types
    which are now used by the transforms.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • This patch changes the calling convention so that on entry from
    x->mode->output and before entry into x->type->output skb->data
    will point to the payload instead of the IP header.

    This is essentially a redistribution of skb_push/skb_pull calls
    with the aim of minimising them on the common path of tunnel +
    ESP.

    It'll also let us use the same calling convention between IPv4
    and IPv6 with the next patch.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • Current the x->mode->output functions store the IPv6 nh pointer in the
    skb network header. This is inconvenient because the network header then
    has to be fixed up before the packet can leave the IPsec stack. The mac
    header field is unused on output so we can use that to store this instead.

    This patch does that and removes the network header fix-up in xfrm_output.

    It also uses ipv6_hdr where appropriate in the x->type->output functions.

    There is also a minor clean-up in esp4 to make it use the same code as
    esp6 to help any subsequent effort to merge the two.

    Lastly it kills two redundant skb_set_* statements in BEET that were
    simply copied over from transport mode.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • This trivial patch removes the unneeded pointer iph, which is never used.

    Signed-off-by: Micah Gruber
    Signed-off-by: David S. Miller

    Micah Gruber
     

11 Jul, 2007

1 commit

  • It is clean-up for XFRM type modules and adds aliases with its
    protocol:
    ESP, AH, IPCOMP, IPIP and IPv6 for IPsec
    ROUTING and DSTOPTS for MIPv6

    It is almost the same thing as XFRM mode alias, but it is added
    new defines XFRM_PROTO_XXX for preprocessing since some protocols
    are defined as enum.

    Signed-off-by: Masahide NAKAMURA
    Acked-by: Ingo Oeser
    Signed-off-by: David S. Miller

    Masahide NAKAMURA
     

26 Apr, 2007

6 commits


11 Feb, 2007

1 commit


03 Dec, 2006

1 commit


04 Oct, 2006

1 commit

  • This patch introduces the BEET mode (Bound End-to-End Tunnel) with as
    specified by the ietf draft at the following link:

    http://www.ietf.org/internet-drafts/draft-nikander-esp-beet-mode-06.txt

    The patch provides only single family support (i.e. inner family =
    outer family).

    Signed-off-by: Diego Beltrami
    Signed-off-by: Miika Komu
    Signed-off-by: Herbert Xu
    Signed-off-by: Abhinav Pathak
    Signed-off-by: Jeff Ahrenholz
    Signed-off-by: David S. Miller

    Diego Beltrami
     

29 Sep, 2006

1 commit


23 Sep, 2006

2 commits

  • On current kernel, ip6_find_1stfragopt() is used by IPv6 IPsec to find
    offset to be inserted header in outbound for transport mode. (BTW, no
    usage may be needed for IPv4 case.) Mobile IPv6 requires another
    logic for routing header and destination options header
    respectively. This patch is common platform for the offset and adopts
    it to IPsec.

    Based on MIPL2 kernel patch.

    Signed-off-by: Masahide NAKAMURA
    Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    Masahide NAKAMURA
     
  • Transformation mode is used as either IPsec transport or tunnel.
    It is required to add two more items, route optimization and inbound trigger
    for Mobile IPv6.
    Based on MIPL2 kernel patch.

    This patch was also written by: Ville Nuorvala

    Signed-off-by: Masahide NAKAMURA
    Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    Masahide NAKAMURA
     

21 Sep, 2006

1 commit


13 Jul, 2006

1 commit

  • The truesize check has uncovered the fact that we forgot to update truesize
    after pskb_expand_head. Unfortunately pskb_expand_head can't update it for
    us because it's used in all sorts of different contexts, some of which would
    not allow truesize to be updated by itself.

    So the solution for now is to simply update it in IPComp.

    This patch also changes skb_put to __skb_put since we've just expanded
    tailroom by exactly that amount so we know it's there (but gcc does not).

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

01 Jul, 2006

1 commit


18 Jun, 2006

2 commits

  • The linearisation operation doesn't need to be super-optimised. So we can
    replace __skb_linearize with __pskb_pull_tail which does the same thing but
    is more general.

    Also, most users of skb_linearize end up testing whether the skb is linear
    or not so it helps to make skb_linearize do just that.

    Some callers of skb_linearize also use it to copy cloned data, so it's
    useful to have a new function skb_linearize_cow to copy the data if it's
    either non-linear or cloned.

    Last but not least, I've removed the gfp argument since nobody uses it
    anymore. If it's ever needed we can easily add it back.

    Misc bugs fixed by this patch:

    * via-velocity error handling (also, no SG => no frags)

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • Now that we have xfrm_mode objects we can move the transport mode specific
    input decapsulation code into xfrm_mode_transport. This removes duplicate
    code as well as unnecessary header movement in case of tunnel mode SAs
    since we will discard the original IP header immediately.

    This also fixes a minor bug for transport-mode ESP where the IP payload
    length is set to the correct value minus the header length (with extension
    headers for IPv6).

    Of course the other neat thing is that we no longer have to allocate
    temporary buffers to hold the IP headers for ESP and IPComp.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

23 May, 2006

1 commit


11 Apr, 2006

1 commit

  • for_each_cpu() actually iterates across all possible CPUs. We've had mistakes
    in the past where people were using for_each_cpu() where they should have been
    iterating across only online or present CPUs. This is inefficient and
    possibly buggy.

    We're renaming for_each_cpu() to for_each_possible_cpu() to avoid this in the
    future.

    This patch replaces for_each_cpu with for_each_possible_cpu under /net

    Signed-off-by: KAMEZAWA Hiroyuki
    Acked-by: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     

01 Apr, 2006

1 commit

  • This patch removes the decap_state argument from the xfrm input hook.
    Previously this function allowed the input hook to share state with
    the post_input hook. The latter has since been removed.

    The only purpose for it now is to check the encap type. However, it
    is easier and better to move the encap type check to the generic
    xfrm_rcv function. This allows us to get rid of the decap state
    argument altogether.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

27 Mar, 2006

1 commit

  • The error handling in ipcomp6_tunnel_create is broken in two ways:

    1) If we fail to allocate an SPI (this should never happen in practice
    since there are plenty of 32-bit SPI values for us to use), we will
    still go ahead and create the SA.

    2) When xfrm_init_state fails, we first of all may trigger the BUG_TRAP
    in __xfrm_state_destroy because we didn't set the state to DEAD. More
    importantly we end up returning the freed state as if we succeeded!

    This patch fixes them both.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

21 Mar, 2006

3 commits