* [PATCH] IPV4 IPComp : threshold comparison
@ 2003-05-17 17:00 Mitsuru KANDA / 神田 充
2003-05-18 1:07 ` James Morris
2003-05-18 5:34 ` David S. Miller
0 siblings, 2 replies; 3+ messages in thread
From: Mitsuru KANDA / 神田 充 @ 2003-05-17 17:00 UTC (permalink / raw)
To: jmorris, davem, kuznet; +Cc: netdev, usagi
Hello,
I'm not sure how exactly we should check threshold.
In IPsec tunnel mode, the original comparison code
seems to be including IP header length.
Could you check it?
Regards,
-mk
===== ipcomp.c 1.6 vs edited =====
--- 1.6/net/ipv4/ipcomp.c Tue May 13 05:58:03 2003
+++ edited/ipcomp.c Sun May 18 01:42:22 2003
@@ -168,6 +168,7 @@
struct iphdr iph;
char buf[60];
} tmp_iph;
+ int hdr_len = 0;
if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) {
err = -EINVAL;
@@ -180,7 +181,11 @@
goto error;
/* Don't bother compressing */
- if (skb->len < ipcd->threshold) {
+ if (!x->props.mode) {
+ iph = skb->nh.iph;
+ hdr_len = iph->ihl * 4;
+ }
+ if ((skb->len - hdr_len) < ipcd->threshold) {
if (x->props.mode) {
ipcomp_tunnel_encap(x, skb);
iph = skb->nh.iph;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] IPV4 IPComp : threshold comparison
2003-05-17 17:00 [PATCH] IPV4 IPComp : threshold comparison Mitsuru KANDA / 神田 充
@ 2003-05-18 1:07 ` James Morris
2003-05-18 5:34 ` David S. Miller
1 sibling, 0 replies; 3+ messages in thread
From: James Morris @ 2003-05-18 1:07 UTC (permalink / raw)
To: Mitsuru KANDA / 神田 充; +Cc: davem, kuznet, netdev, usagi
On Sun, 18 May 2003, Mitsuru KANDA / [ISO-2022-JP] ^[$B?@ED^[(B ^[$B=<^[(B wrote:
> I'm not sure how exactly we should check threshold.
We should check the length of the IP payload, which the current code is
only currently doing for tunnel mode.
> In IPsec tunnel mode, the original comparison code
> seems to be including IP header length.
It is counting the inner IP header, which is correct, as it is part of the
final IP payload. The transport mode calculation is incorrect.
> Could you check it?
Your patch fixes the calculation for transport mode, and looks correct.
- James
--
James Morris
<jmorris@intercode.com.au>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] IPV4 IPComp : threshold comparison
2003-05-17 17:00 [PATCH] IPV4 IPComp : threshold comparison Mitsuru KANDA / 神田 充
2003-05-18 1:07 ` James Morris
@ 2003-05-18 5:34 ` David S. Miller
1 sibling, 0 replies; 3+ messages in thread
From: David S. Miller @ 2003-05-18 5:34 UTC (permalink / raw)
To: mk; +Cc: jmorris, kuznet, netdev, usagi
From: Mitsuru KANDA / 神田 充 <mk@linux-ipv6.org>
Date: Sun, 18 May 2003 02:00:01 +0900
===== ipcomp.c 1.6 vs edited =====
--- 1.6/net/ipv4/ipcomp.c Tue May 13 05:58:03 2003
+++ edited/ipcomp.c Sun May 18 01:42:22 2003
I am applying this, but please you USAGI guys start to
generate properly rooted patched for me ok?
I want something of the form:
--- a/net/ipv4/ipcomp.c Tue May 13 05:58:03 2003
+++ b/net/ipv4/ipcomp.c Sun May 18 01:42:22 2003
Almost everyone sends me patches like this, USAGI are
the one exception. If everyone sends me patches this
way, then all of my patch applying scripts know they can
simply use "patch -p1" when sitting at top of kernel tree.
Probably all of the USAGI patches look this way because of
CVS or something like that.
Thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-05-18 5:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-17 17:00 [PATCH] IPV4 IPComp : threshold comparison Mitsuru KANDA / 神田 充
2003-05-18 1:07 ` James Morris
2003-05-18 5:34 ` 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).