.nla_policy= nf_ct_port_nla_policy, #endif #ifdef CONFIG_SYSCTL .ctl_table_users= &udp...
nat = nf_ct_nat_ext_add(ct); if (nat) nat->masq_index = out->ifindex; newrange.flags = range->flags | NF_NAT_RANGE_MAP_IPS; newrange.min_addr.in6 = src; newrange.max_addr.in6 = src; newrange.min_proto = range->min_proto; newrange.max_proto = range->max_proto...
}/*根据skb L3和L4层的信息 得到一个nf_conn结构*/ct=resolve_normal_ct(net, tmpl, skb, dataoff, pf, protonum, l3proto, l4proto,&set_reply, &ctinfo);if(!ct) {/*Not valid part of a connection*/NF_CT_STAT_INC_ATOMIC(net, invalid); ret=NF_ACCEPT;gotoout; }if(IS_ERR(ct)) {/...
#define NF_CT_EXT_NAT_TYPE struct nf_conn_nat #define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter #define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache -#define NF_CT_EXT_NEW_TYPE struct nf_conntrack_new +#ifdef NFCT_EXT_EXT +#define NF_CT_EXT_EXT_TYPE struct nf_conntrack_ext...
This repository is a mirror of https://git.openwrt.org/openwrt/openwrt.git It is for reference only and is not active for check-ins. We will continue to accept Pull Requests here. They will be merged via staging trees then into openwrt.git. - kernel: sy
MAX_EXT_SLOTS 8 #define BITINT 1 struct nf_conntrack_ext { /* 必须有一个数组用于自省或者反射 */ int bits_idx[MAX_EXT_SLOTS]; int bits[BITINT]; char *slot[MAX_EXT_SLOTS]; }; int nf_ct_exts_add(const struct nf_conn *ct, void *ext); void *nf_ct_exts_get(const struct nf_...
NFCT_EXT_EXT+/* 引入extend的extend头文件 */+#include <net/netfilter/nf_conntrack_ext.h>+#endif #include <net/netfilter/nf_nat.h> #include <net/netfilter/nf_nat_core.h>@@ -644,8 +648,11 @@ } nf_ct_acct_ext_add(ct, GFP_ATOMIC);- nf_ct_ecache_ext_add(ct, GFP_ATOMIC);+#...
目前conntrack扩展有acct,helper,nat三种。它存储在*nf_ct_ext_types[NF_CT_EXT_NUM]全局数组中。 以nf_conntrack_acct为例: /net/netfilter/nf_conntrack_acct.c 初始化 59static structnf_ct_ext_typeacct_extend__read_mostly= { 60.len= sizeof(structnf_conn_counter[IP_CT_DIR_MAX]), ...
320&net->ct.hash[hash]); 321hlist_nulls_add_head_rcu(&ct->tuplehash[IP_CT_DIR_REPLY].hnnode, 322&net->ct.hash[repl_hash]); 323} 3.记录的删除 59staticinlinevoidhlist_nulls_del_rcu(structhlist_nulls_node*n) 60{ 61__hlist_nulls_del(n); ...
111 (void *)ct->ext + ct->ext->offset[i]); [NETFILTER]: nf_conntrack: introduce extension infrastructure 15 years ago 112 rcu_read_unlock(); 113 } netfilter: nf_nat: fix RCU races 14 years ago 114 call_rcu(&ct->ext->rcu, __nf_ct_ext_free_rcu); [...