diff options
author | Patrick McHardy <kaber@trash.net> | 2007-04-09 11:46:17 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-25 22:28:37 -0700 |
commit | 557922584d9c5b6b990bcfb2fec3134f0e73a05d (patch) | |
tree | f7944ace44efa532fbee23db0709760bfb70ec98 /net/ipv4 | |
parent | 56eb88828b78f6f3b11a2996350092a40745301f (diff) | |
download | linux-stable-557922584d9c5b6b990bcfb2fec3134f0e73a05d.tar.gz linux-stable-557922584d9c5b6b990bcfb2fec3134f0e73a05d.tar.bz2 linux-stable-557922584d9c5b6b990bcfb2fec3134f0e73a05d.zip |
[XFRM]: esp: fix skb_tail_pointer conversion bug
Fix incorrect switch of "trailer" skb by "skb" during skb_tail_pointer
conversion:
- *(u8*)(trailer->tail - 1) = top_iph->protocol;
+ *(skb_tail_pointer(skb) - 1) = top_iph->protocol;
- *(u8 *)(trailer->tail - 1) = *skb_network_header(skb);
+ *(skb_tail_pointer(skb) - 1) = *skb_network_header(skb);
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/esp4.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index 5e5613930ffb..bdc65d8af181 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c @@ -64,7 +64,7 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb) esph = (struct ip_esp_hdr *)(skb_network_header(skb) + top_iph->ihl * 4); top_iph->tot_len = htons(skb->len + alen); - *(skb_tail_pointer(skb) - 1) = top_iph->protocol; + *(skb_tail_pointer(trailer) - 1) = top_iph->protocol; /* this is non-NULL only with UDP Encapsulation */ if (x->encap) { |