netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [NATT] Fix uh->len with IP options
@ 2004-07-09 11:48 Herbert Xu
  2004-07-10  0:05 ` David S. Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2004-07-09 11:48 UTC (permalink / raw)
  To: David S. Miller, netdev

[-- Attachment #1: Type: text/plain, Size: 439 bytes --]

Hi Dave:

I just noticed that the UDP header length in esp4_output() is incorrect
when IP options are present (in transport mode).  This patch fixes exactly
that.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: p --]
[-- Type: text/plain, Size: 440 bytes --]

===== net/ipv4/esp4.c 1.50 vs edited =====
--- 1.50/net/ipv4/esp4.c	2004-07-09 20:19:08 +10:00
+++ edited/net/ipv4/esp4.c	2004-07-09 21:45:46 +10:00
@@ -124,7 +124,7 @@
 		uh = (struct udphdr *)esph;
 		uh->source = encap->encap_sport;
 		uh->dest = encap->encap_dport;
-		uh->len = htons((*pskb)->len + alen - sizeof(struct iphdr));
+		uh->len = htons((*pskb)->len + alen - iph->ihl*4);
 		uh->check = 0;
 
 		switch (encap->encap_type) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-07-10  1:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-09 11:48 [NATT] Fix uh->len with IP options Herbert Xu
2004-07-10  0:05 ` David S. Miller
2004-07-10  1:21   ` Herbert Xu

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).