17 #include <linux/netfilter_ipv6.h>
18 #include <linux/export.h>
32 sel->
dport = xfrm_flowi_dport(fl, &fl6->
uli);
34 sel->
sport = xfrm_flowi_sport(fl, &fl6->
uli);
39 sel->
proto = fl6->flowi6_proto;
48 if (ipv6_addr_any((
struct in6_addr*)&x->
id.daddr))
60 __xfrm6_sort(
void **
dst,
void **
src,
int n,
int (*cmp)(
void *
p),
int maxclass)
66 memset(count, 0,
sizeof(count));
68 for (i = 0; i <
n; i++) {
70 class[
i] = c = cmp(src[i]);
74 for (i = 2; i < maxclass; i++)
75 count[i] += count[i - 1];
77 for (i = 0; i <
n; i++) {
78 dst[count[
class[
i] - 1]++] = src[
i];
94 static int __xfrm6_state_sort_cmp(
void *p)
98 switch (v->
props.mode) {
104 #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
119 return __xfrm6_sort((
void **)dst, (
void **)src, n,
120 __xfrm6_state_sort_cmp, 6);
131 static int __xfrm6_tmpl_sort_cmp(
void *p)
137 #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
152 return __xfrm6_sort((
void **)dst, (
void **)src, n,
153 __xfrm6_tmpl_sort_cmp, 5);
158 struct ipv6hdr *iph = ipv6_hdr(skb);
177 .init_tempsel = __xfrm6_init_tempsel,
178 .init_temprop = xfrm6_init_temprop,
179 .tmpl_sort = __xfrm6_tmpl_sort,
180 .state_sort = __xfrm6_state_sort,