• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
nft_set_pktinfo_ipv6(struct nft_pktinfo * pkt,const struct nf_hook_ops * ops,struct sk_buff * skb,const struct net_device * in,const struct net_device * out)8 nft_set_pktinfo_ipv6(struct nft_pktinfo *pkt,
9 		     const struct nf_hook_ops *ops,
10 		     struct sk_buff *skb,
11 		     const struct net_device *in,
12 		     const struct net_device *out)
13 {
14 	int protohdr, thoff = 0;
15 	unsigned short frag_off;
16 
17 	nft_set_pktinfo(pkt, ops, skb, in, out);
18 
19 	protohdr = ipv6_find_hdr(pkt->skb, &thoff, -1, &frag_off, NULL);
20 	/* If malformed, drop it */
21 	if (protohdr < 0)
22 		return -1;
23 
24 	pkt->tprot = protohdr;
25 	pkt->xt.thoff = thoff;
26 	pkt->xt.fragoff = frag_off;
27 
28 	return 0;
29 }
30 
31 extern struct nft_af_info nft_af_ipv6;
32 
33 #endif
34