Commit fc0b7729 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[IPSEC]: Fix uh->len when doing NATT with IP options.

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: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent 8f5f8380
......@@ -124,7 +124,7 @@ int esp_output(struct sk_buff **pskb)
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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment