• Herbert Xu's avatar
    [IPSEC]: Do xfrm_state_check_space before encapsulation · 910ef70a
    Herbert Xu authored
    While merging the IPsec output path I moved the encapsulation output
    operation to the top of the loop so that it sits outside of the locked
    section.  Unfortunately in doing so it now sits in front of the space
    check as well which could be a fatal error.
    
    This patch rearranges the calls so that the space check happens as
    the thing on the output path.
    
    This patch also fixes an incorrect goto should the encapsulation output
    fail.
    
    Thanks to Kazunori MIYAZAWA for finding this bug.
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    910ef70a
xfrm_output.c 3.32 KB