Hello, Clayton Weaver and all,


CW> (Patch isn't quite right.)
No, patch is right, the source code example was wrong, I mistyped
them. Sorry.

>>         if(skb2 != NULL)
>>         {
>>                 skb_reserve(skb2, out_offset);
>>                 skb2->nh.raw =
>>                 skb2->h.raw = skb_put(skb2,skb->len);
>>                 memcpy(skb2->h.raw, skb->h.raw, skb->len);
>>         }
>>         kfree_skb(NULL);

CW>           ^^^^^^^^^^^^^^^^  This line looks different in patch,
CW> but patch doesn't change it. The patch looks as if this reads
CW> "kfree_skb(skb);" in both versions of the file.
Yes. Yoy're right. I was mistyped them, of course.

>>         return (NULL);
>> }
>> <----- end cut
>> 

CW> [snip]
 
>> The appropriate patch shown here:
 
>> <---- patch
>> diff -u af_ipx.c af_ipx.c.orig
>> --- af_ipx.c    Fri Apr 21 17:17:34 2000
>> +++ af_ipx.c.orig       Mon Sep 27 00:00:00 1999
>> @@ -602,7 +602,7 @@
>>         }
>>         kfree_skb(skb);
Here's right line.

>> 
>> -       return (skb2);
>> +       return (NULL);
>>  }
>> 
>>  static int ipxitf_send(ipx_interface *intrfc, struct sk_buff *skb, char *node)
>> <---- end patch
 
CW> See? The patch only changes the return line at the end, but your
CW> original description has the line above it as "kfree_skb(NULL)",
CW> so the patch should change that line too, ie

CW> -        kfree_skb(skb);
CW> +        kfree_skb(NULL):
No, no. Must be kfree(skb);

CW> It looks like the patch was made against a file that already had
CW> the "kfree_skb(skb);" change.
Yes.

CW> Also, you might change the file order when making such diffs, so
CW> that you have the original file first and the new file second
CW> in the diff command line. That makes patches look like

CW> -  /* old_code */;
CW> +  /* new_code */;
No. The order is right.


CW> It shouldn't be a big problem, people who program C and have used
CW> diff/patch often will immediately see what needs to be done from your
CW> description, even if the patch that you posted does not quite do that.
You're right absolutely.

CW> Regards,

CW> Clayton Weaver
CW> <mailto:[EMAIL PROTECTED]>
CW> (Seattle)

CW> "Everybody's ignorant, just in different subjects."  Will Rogers

Thank you for paying attention to my mistyping.

So the right original code will look like this:

<--- cut
static struct sk_buff *ipxitf_adjust_skbuff(ipx_interface *intrfc, struct sk_buff *skb)
{
        struct sk_buff *skb2;
        int in_offset = skb->h.raw - skb->head;
        int out_offset = intrfc->if_ipx_offset;
        int len;

        /* Hopefully, most cases */
        if(in_offset >= out_offset)
                return (skb);

        /* Need new SKB */
        len  = skb->len + out_offset;
        skb2 = alloc_skb(len, GFP_ATOMIC);
        if(skb2 != NULL)
        {
                skb_reserve(skb2, out_offset);
                skb2->nh.raw =
                skb2->h.raw = skb_put(skb2,skb->len);
                memcpy(skb2->h.raw, skb->h.raw, skb->len);
        }
        kfree_skb(skb);

        return (NULL);
}
<---cut

--
Alexandr S. Agranovsky
[EMAIL PROTECTED]


-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to