* [PATCH] IPv4 IPComp
@ 2003-05-07 17:52 Mitsuru KANDA / 神田 充
2003-05-08 0:53 ` James Morris
0 siblings, 1 reply; 3+ messages in thread
From: Mitsuru KANDA / 神田 充 @ 2003-05-07 17:52 UTC (permalink / raw)
To: jmorris, davem, kuznet; +Cc: netdev, usagi-core
Hello,
In ipcomp_input():
The original IP header(iph) is stored(copied) in tmp_iph.
But after skb_pull(), tmp_iph is copied back to
same place where the original IP header exists in skb->nh.raw.
I believe the attached diff is to fix it for correct behavior
which you intend.
Could you check it?
Regards,
-mk
===== ipcomp.c 1.4 vs edited =====
--- 1.4/net/ipv4/ipcomp.c Sun May 4 22:26:55 2003
+++ edited/ipcomp.c Thu May 8 02:41:47 2003
@@ -94,7 +94,9 @@
memcpy(&tmp_iph, iph, iph->ihl * 4);
nexthdr = *(u8 *)skb->data;
skb_pull(skb, sizeof(struct ipcomp_hdr));
+ skb->nh.raw += sizeof(struct ipcomp_hdr);
memcpy(skb->nh.raw, &tmp_iph, tmp_iph.iph.ihl * 4);
+ iph = skb->nh.iph;
iph->tot_len = htons(ntohs(iph->tot_len) - sizeof(struct ipcomp_hdr));
iph->protocol = nexthdr;
skb->h.raw = skb->data;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] IPv4 IPComp
2003-05-07 17:52 [PATCH] IPv4 IPComp Mitsuru KANDA / 神田 充
@ 2003-05-08 0:53 ` James Morris
2003-05-08 15:03 ` David S. Miller
0 siblings, 1 reply; 3+ messages in thread
From: James Morris @ 2003-05-08 0:53 UTC (permalink / raw)
To: Mitsuru KANDA / 神田 充
Cc: davem, kuznet, netdev, usagi-core
On Thu, 8 May 2003, Mitsuru KANDA / [ISO-2022-JP] ^[$B?@ED^[(B ^[$B=<^[(B wrote:
>
> Hello,
>
> In ipcomp_input():
>
> The original IP header(iph) is stored(copied) in tmp_iph.
>
> But after skb_pull(), tmp_iph is copied back to
> same place where the original IP header exists in skb->nh.raw.
>
> I believe the attached diff is to fix it for correct behavior
> which you intend.
>
> Could you check it?
This looks correct.
Dave, please apply.
- James
--
James Morris
<jmorris@intercode.com.au>
--- bk.pending/net/ipv4/ipcomp.c Mon May 5 15:12:29 2003
+++ bk.w1/net/ipv4/ipcomp.c Thu May 8 09:59:01 2003
@@ -94,7 +94,9 @@
memcpy(&tmp_iph, iph, iph->ihl * 4);
nexthdr = *(u8 *)skb->data;
skb_pull(skb, sizeof(struct ipcomp_hdr));
+ skb->nh.raw += sizeof(struct ipcomp_hdr);
memcpy(skb->nh.raw, &tmp_iph, tmp_iph.iph.ihl * 4);
+ iph = skb->nh.iph;
iph->tot_len = htons(ntohs(iph->tot_len) - sizeof(struct ipcomp_hdr));
iph->protocol = nexthdr;
skb->h.raw = skb->data;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-05-08 15:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-07 17:52 [PATCH] IPv4 IPComp Mitsuru KANDA / 神田 充
2003-05-08 0:53 ` James Morris
2003-05-08 15:03 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).