Subject: Re: PROBLEM: a trivial bug in __copy_skb_header() ?

From: Arnaldo Carvalho de Melo <[email-masked]>
Date: Fri, 20 Feb 2009 09:59:42 -0300

Em Fri, Feb 20, 2009 at 04:45:33PM +0800, Chu XJ escreveu:
> Hi, all
> 
>      I'm just a newbie of Linux kernel from China. I just wonder
> whether it should be "#ifdef CONFIG_XFRM" at the 504th line of
> net/core/skbuff.c in the V2.6.28 source tree and previous version.

Fairly recent code:

static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
{
        new->tstamp             = old->tstamp;
        new->dev                = old->dev;
        new->transport_header   = old->transport_header;
        new->network_header     = old->network_header;
        new->mac_header         = old->mac_header;
        new->dst                = dst_clone(old->dst);
#ifdef CONFIG_XFRM
        new->sp                 = secpath_get(old->sp);
#endif
        memcpy(new->cb, old->cb, sizeof(old->cb));
        new->csum_start         = old->csum_start;
        new->csum_offset        = old->csum_offset;
        new->local_df           = old->local_df;
        new->pkt_type           = old->pkt_type;
        new->ip_summed          = old->ip_summed;
        skb_copy_queue_mapping(new, old);
        new->priority           = old->priority;

Where do you think there is a problem?

- Arnaldo