Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24.4 /net/ipv6/ipcomp6.c

Filename:/net/ipv6/ipcomp6.c
Lines Added:6
Lines Deleted:1
Also changed in: (Previous) 2.6.24.4-rc3  2.6.24.4-rc2  2.6.24.4-rc1  2.6.24.3  2.6.24.3-rc1  2.6.24-git22 
(Following) 2.6.24.5  2.6.24.6  2.6.24.7  2.6.25-rc7  2.6.25-rc8  2.6.25-rc9 

Location
[  2.6.24.4
  [  net
    [  ipv6
       o  ipcomp6.c

Patch

diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 0cd4056..f46c38f 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -64,6 +64,7 @@ static LIST_HEAD(ipcomp6_tfms_list);
 
 static int ipcomp6_input(struct xfrm_state *x, struct sk_buff *skb)
 {
+   int nexthdr;
    int err = -ENOMEM;
    struct ip_comp_hdr *ipch;
    int plen, dlen;
@@ -79,6 +80,8 @@ static int ipcomp6_input(struct xfrm_state *x, struct sk_buff *skb)
 
    /* Remove ipcomp header and decompress original payload */
    ipch = (void *)skb->data;
+   nexthdr = ipch->nexthdr;
+
    skb->transport_header = skb->network_header + sizeof(*ipch);
    __skb_pull(skb, sizeof(*ipch));
 
@@ -108,7 +111,7 @@ static int ipcomp6_input(struct xfrm_state *x, struct sk_buff *skb)
    skb->truesize += dlen - plen;
    __skb_put(skb, dlen - plen);
    skb_copy_to_linear_data(skb, scratch, dlen);
-   err = ipch->nexthdr;
+   err = nexthdr;
 
 out_put_cpu:
    put_cpu();
@@ -143,7 +146,9 @@ static int ipcomp6_output(struct xfrm_state *x, struct sk_buff *skb)
    scratch = *per_cpu_ptr(ipcomp6_scratches, cpu);
    tfm = *per_cpu_ptr(ipcd->tfms, cpu);
 
+   local_bh_disable();
    err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
+   local_bh_enable();
    if (err || (dlen + sizeof(*ipch)) >= plen) {
       put_cpu();
       goto out_ok;


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.