12 #include <linux/kernel.h>
13 #include <linux/module.h>
20 static void xfrm4_beet_make_header(
struct sk_buff *
skb)
22 struct iphdr *iph = ip_hdr(skb);
42 struct iphdr *top_iph;
50 skb_set_network_header(skb, -x->
props.header_len -
58 xfrm4_beet_make_header(skb);
63 top_iph = ip_hdr(skb);
68 ph->
padlen = 4 - (optlen & 4);
75 top_iph->ihl =
sizeof(
struct iphdr) / 4;
79 top_iph->
daddr = x->
id.daddr.a4;
94 if (!pskb_may_pull(skb,
sizeof(*ph)))
99 phlen =
sizeof(*ph) + ph->
padlen;
101 if (optlen < 0 || optlen & 3 || optlen > 250)
106 if (!pskb_may_pull(skb, phlen))
108 __skb_pull(skb, phlen);
112 skb_reset_network_header(skb);
113 skb_mac_header_rebuild(skb);
115 xfrm4_beet_make_header(skb);
119 iph->ihl += optlen / 4;
130 static struct xfrm_mode xfrm4_beet_mode = {
131 .input2 = xfrm4_beet_input,
133 .output2 = xfrm4_beet_output,
140 static int __init xfrm4_beet_init(
void)
145 static void __exit xfrm4_beet_exit(
void)