10 #include <linux/kernel.h>
11 #include <linux/module.h>
21 static inline void ipip6_ecn_decapsulate(
struct sk_buff *
skb)
23 const struct ipv6hdr *outer_iph = ipv6_hdr(skb);
24 struct ipv6hdr *inner_iph = ipipv6_hdr(skb);
26 if (INET_ECN_is_ce(ipv6_get_dsfield(outer_iph)))
27 IP6_ECN_set_ce(inner_iph);
40 skb_set_network_header(skb, -x->
props.header_len);
44 top_iph = ipv6_hdr(skb);
50 top_iph->
nexthdr = xfrm_af2proto(skb_dst(skb)->
ops->family);
53 dsfield = INET_ECN_encapsulate(dsfield, dsfield);
56 ipv6_change_dsfield(top_iph, 0, dsfield);
69 if (!pskb_may_pull(skb,
sizeof(
struct ipv6hdr)))
72 if (skb_cloned(skb) &&
77 ipv6_copy_dscp(ipv6_get_dsfield(ipv6_hdr(skb)),
80 ipip6_ecn_decapsulate(skb);
82 skb_reset_network_header(skb);
83 skb_mac_header_rebuild(skb);
91 static struct xfrm_mode xfrm6_tunnel_mode = {
92 .input2 = xfrm6_mode_tunnel_input,
94 .output2 = xfrm6_mode_tunnel_output,
101 static int __init xfrm6_mode_tunnel_init(
void)
106 static void __exit xfrm6_mode_tunnel_exit(
void)