diff options
author | Patrick McHardy <kaber@trash.net> | 2007-04-05 15:54:02 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-04-05 15:54:02 -0700 |
commit | c5027c9a896fbe05367fb893a274deca5114bfd0 (patch) | |
tree | 0deedc7c6e8edbd9e0dcc255a2f64bcc8c1ab1da /net/ipv4/xfrm4_mode_beet.c | |
parent | 4c4d51a7316b164ba08af61aa0c124a88bc60450 (diff) | |
download | talos-op-linux-c5027c9a896fbe05367fb893a274deca5114bfd0.tar.gz talos-op-linux-c5027c9a896fbe05367fb893a274deca5114bfd0.zip |
[XFRM]: beet: fix IP option encapsulation
Beet mode calculates an incorrect value for the transport header location
when IP options are present, resulting in encapsulation errors.
The correct location is 4 or 8 bytes before the end of the original IP
header, depending on whether the pseudo header is padded.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/xfrm4_mode_beet.c')
-rw-r--r-- | net/ipv4/xfrm4_mode_beet.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv4/xfrm4_mode_beet.c b/net/ipv4/xfrm4_mode_beet.c index 89cf59ea7bbe..16efc66a7c3f 100644 --- a/net/ipv4/xfrm4_mode_beet.c +++ b/net/ipv4/xfrm4_mode_beet.c @@ -42,10 +42,9 @@ static int xfrm4_beet_output(struct xfrm_state *x, struct sk_buff *skb) skb->nh.raw = skb_push(skb, x->props.header_len + hdrlen); top_iph = skb->nh.iph; - hdrlen = iph->ihl * 4 - optlen; - skb->h.raw += hdrlen; + skb->h.raw += sizeof(*iph) - hdrlen; - memmove(top_iph, iph, hdrlen); + memmove(top_iph, iph, sizeof(*iph)); if (unlikely(optlen)) { struct ip_beet_phdr *ph; |