29 Jan, 2008

2 commits

  • Currently x->lastused is u64 which means that it cannot be
    read/written atomically on all architectures. David Miller observed
    that the value stored in it is only an unsigned long which is always
    atomic.

    So based on his suggestion this patch changes the internal
    representation from u64 to unsigned long while the user-interface
    still refers to it as u64.

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

    Herbert Xu
     
  • RO mode is the only one that requires a locked output function. So
    it's easier to move the lock into that function rather than requiring
    everyone else to run under the lock.

    In particular, this allows us to move the size check into the output
    function without causing a potential dead-lock should the ICMP error
    somehow hit the same SA on transmission.

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

    Herbert Xu
     

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

4 commits

  • The IPv6 calling convention for x->mode->output is more general and could
    help an eventual protocol-generic x->type->output implementation. This
    patch adopts it for IPv4 as well and modifies the IPv4 type output functions
    accordingly.

    It also rewrites the IPv6 mac/transport header calculation to be based off
    the network header where practical.

    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
     
  • The lastused update check in xfrm_output can be done just as well in
    the mode output function which is specific to RO.

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

    Herbert Xu
     

26 Apr, 2007

3 commits


23 Sep, 2006

2 commits