12 #include <linux/if_ether.h>
13 #include <linux/kernel.h>
14 #include <linux/module.h>
16 #include <linux/icmpv6.h>
17 #include <linux/netfilter_ipv6.h>
31 static int xfrm6_local_dontfrag(
struct sk_buff *
skb)
40 return inet6_sk(sk)->dontfrag;
46 static void xfrm6_local_rxpmtu(
struct sk_buff *skb,
u32 mtu)
51 fl6.flowi6_oif = sk->sk_bound_dev_if;
52 fl6.daddr = ipv6_hdr(skb)->daddr;
57 static void xfrm6_local_error(
struct sk_buff *skb,
u32 mtu)
62 fl6.fl6_dport = inet_sk(sk)->inet_dport;
63 fl6.daddr = ipv6_hdr(skb)->daddr;
68 static int xfrm6_tunnel_check_size(
struct sk_buff *skb)
80 if (xfrm6_local_dontfrag(skb))
81 xfrm6_local_rxpmtu(skb, mtu);
83 xfrm6_local_error(skb, mtu);
96 err = xfrm6_tunnel_check_size(skb);
114 #ifdef CONFIG_NETFILTER
127 #ifdef CONFIG_NETFILTER
135 static int __xfrm6_output(
struct sk_buff *skb)
139 int mtu = ip6_skb_dst_mtu(skb);
141 if (skb->
len > mtu && xfrm6_local_dontfrag(skb)) {
142 xfrm6_local_rxpmtu(skb, mtu);
145 xfrm6_local_error(skb, mtu);
150 ((skb->
len > mtu && !skb_is_gso(skb)) ||
151 dst_allfrag(skb_dst(skb)))) {
154 return x->
outer_mode->afinfo->output_finish(skb);
160 skb_dst(skb)->
dev, __xfrm6_output);