mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 17:59:32 +00:00
6aa187f21c
- Add nft_pktinfo.pf to replace ops->pf - Add nft_pktinfo.hook to replace ops->hooknum This simplifies the code, makes it more readable, and likely reduces cache line misses. Maintainability is enhanced as the details of nft_hook_ops are of no concern to the recpients of nft_pktinfo. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
24 lines
498 B
C
24 lines
498 B
C
#ifndef _NF_TABLES_IPV4_H_
|
|
#define _NF_TABLES_IPV4_H_
|
|
|
|
#include <net/netfilter/nf_tables.h>
|
|
#include <net/ip.h>
|
|
|
|
static inline void
|
|
nft_set_pktinfo_ipv4(struct nft_pktinfo *pkt,
|
|
struct sk_buff *skb,
|
|
const struct nf_hook_state *state)
|
|
{
|
|
struct iphdr *ip;
|
|
|
|
nft_set_pktinfo(pkt, skb, state);
|
|
|
|
ip = ip_hdr(pkt->skb);
|
|
pkt->tprot = ip->protocol;
|
|
pkt->xt.thoff = ip_hdrlen(pkt->skb);
|
|
pkt->xt.fragoff = ntohs(ip->frag_off) & IP_OFFSET;
|
|
}
|
|
|
|
extern struct nft_af_info nft_af_ipv4;
|
|
|
|
#endif
|