1 #include <linux/kernel.h>
2 #include <linux/netfilter.h>
3 #include <linux/netfilter_ipv4.h>
4 #include <linux/netfilter_ipv6.h>
5 #include <net/netfilter/nf_queue.h>
7 __sum16
nf_checksum(struct sk_buff
*skb
, unsigned int hook
,
8 unsigned int dataoff
, u_int8_t protocol
,
11 const struct nf_ipv6_ops
*v6ops
;
16 csum
= nf_ip_checksum(skb
, hook
, dataoff
, protocol
);
19 v6ops
= rcu_dereference(nf_ipv6_ops
);
21 csum
= v6ops
->checksum(skb
, hook
, dataoff
, protocol
);
27 EXPORT_SYMBOL_GPL(nf_checksum
);
29 __sum16
nf_checksum_partial(struct sk_buff
*skb
, unsigned int hook
,
30 unsigned int dataoff
, unsigned int len
,
31 u_int8_t protocol
, unsigned short family
)
33 const struct nf_ipv6_ops
*v6ops
;
38 csum
= nf_ip_checksum_partial(skb
, hook
, dataoff
, len
,
42 v6ops
= rcu_dereference(nf_ipv6_ops
);
44 csum
= v6ops
->checksum_partial(skb
, hook
, dataoff
, len
,
51 EXPORT_SYMBOL_GPL(nf_checksum_partial
);
53 int nf_route(struct net
*net
, struct dst_entry
**dst
, struct flowi
*fl
,
54 bool strict
, unsigned short family
)
56 const struct nf_ipv6_ops
*v6ops
;
61 ret
= nf_ip_route(net
, dst
, fl
, strict
);
64 v6ops
= rcu_dereference(nf_ipv6_ops
);
66 ret
= v6ops
->route(net
, dst
, fl
, strict
);
72 EXPORT_SYMBOL_GPL(nf_route
);
74 int nf_reroute(struct sk_buff
*skb
, struct nf_queue_entry
*entry
)
76 const struct nf_ipv6_ops
*v6ops
;
79 switch (entry
->state
.pf
) {
81 ret
= nf_ip_reroute(skb
, entry
);
84 v6ops
= rcu_dereference(nf_ipv6_ops
);
86 ret
= v6ops
->reroute(skb
, entry
);