Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 1 | #ifndef _NF_TABLES_IPV6_H_ |
| 2 | #define _NF_TABLES_IPV6_H_ |
| 3 | |
| 4 | #include <linux/netfilter_ipv6/ip6_tables.h> |
| 5 | #include <net/ipv6.h> |
| 6 | |
| 7 | static inline int |
| 8 | nft_set_pktinfo_ipv6(struct nft_pktinfo *pkt, |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 9 | struct sk_buff *skb, |
David S. Miller | 073bfd5 | 2015-04-03 21:16:25 -0400 | [diff] [blame] | 10 | const struct nf_hook_state *state) |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 11 | { |
| 12 | int protohdr, thoff = 0; |
| 13 | unsigned short frag_off; |
| 14 | |
Eric W. Biederman | 6aa187f | 2015-09-18 14:32:57 -0500 | [diff] [blame] | 15 | nft_set_pktinfo(pkt, skb, state); |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 16 | |
| 17 | protohdr = ipv6_find_hdr(pkt->skb, &thoff, -1, &frag_off, NULL); |
Pablo Neira Ayuso | 8df9e32 | 2016-09-09 12:42:50 +0200 | [diff] [blame^] | 18 | if (protohdr < 0) { |
| 19 | nft_set_pktinfo_proto_unspec(pkt, skb); |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 20 | return -1; |
Pablo Neira Ayuso | 8df9e32 | 2016-09-09 12:42:50 +0200 | [diff] [blame^] | 21 | } |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 22 | |
Pablo Neira Ayuso | beac5af | 2016-09-09 12:42:49 +0200 | [diff] [blame] | 23 | pkt->tprot_set = true; |
Patrick McHardy | 4566bf2 | 2014-01-03 12:16:18 +0000 | [diff] [blame] | 24 | pkt->tprot = protohdr; |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 25 | pkt->xt.thoff = thoff; |
| 26 | pkt->xt.fragoff = frag_off; |
| 27 | |
| 28 | return 0; |
| 29 | } |
| 30 | |
Patrick McHardy | 1d49144 | 2014-01-03 12:16:16 +0000 | [diff] [blame] | 31 | extern struct nft_af_info nft_af_ipv6; |
| 32 | |
Pablo Neira Ayuso | 0ca743a | 2013-10-14 00:06:06 +0200 | [diff] [blame] | 33 | #endif |