aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2008-03-26 19:51:09 -0400
committerDavid S. Miller <davem@davemloft.net>2008-03-26 19:51:09 -0400
commit732c8bd590625e8bc0b88313b82930e336b2bec4 (patch)
tree1cf3f6b9db7b886d35bbf38bab2ca6ff82d206d8 /include/net
parent0e5606e4f46b7cf52dd445af01e71ed9dbb7f735 (diff)
[IPSEC]: Fix BEET output
The IPv6 BEET output function is incorrectly including the inner header in the payload to be protected. This causes a crash as the packet doesn't actually have that many bytes for a second header. The IPv4 BEET output on the other hand is broken when it comes to handling an inner IPv6 header since it always assumes an inner IPv4 header. This patch fixes both by making sure that neither BEET output function touches the inner header at all. All access is now done through the protocol-independent cb structure. Two new attributes are added to make this work, the IP header length and the IPv4 option length. They're filled in by the inner mode's output function. Thanks to Joakim Koskela for finding this problem. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/xfrm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 4e6f9568cbe7..0d255ae008b6 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -552,6 +552,9 @@ struct xfrm_mode_skb_cb {
552 __be16 id; 552 __be16 id;
553 __be16 frag_off; 553 __be16 frag_off;
554 554
555 /* IP header length (excluding options or extension headers). */
556 u8 ihl;
557
555 /* TOS for IPv4, class for IPv6. */ 558 /* TOS for IPv4, class for IPv6. */
556 u8 tos; 559 u8 tos;
557 560
@@ -561,6 +564,9 @@ struct xfrm_mode_skb_cb {
561 /* Protocol for IPv4, NH for IPv6. */ 564 /* Protocol for IPv4, NH for IPv6. */
562 u8 protocol; 565 u8 protocol;
563 566
567 /* Option length for IPv4, zero for IPv6. */
568 u8 optlen;
569
564 /* Used by IPv6 only, zero for IPv4. */ 570 /* Used by IPv6 only, zero for IPv4. */
565 u8 flow_lbl[3]; 571 u8 flow_lbl[3];
566}; 572};