struct netns_ieee802154_lowpan {
struct netns_sysctl_lowpan sysctl;
- struct fqdir frags;
+ struct fqdir fqdir;
};
#endif
struct inet_peer_base *peers;
struct sock * __percpu *tcp_sk;
- struct fqdir frags;
+ struct fqdir fqdir;
#ifdef CONFIG_NETFILTER
struct xt_table *iptable_filter;
struct xt_table *iptable_mangle;
struct ipv6_devconf *devconf_all;
struct ipv6_devconf *devconf_dflt;
struct inet_peer_base *peers;
- struct fqdir frags;
+ struct fqdir fqdir;
#ifdef CONFIG_NETFILTER
struct xt_table *ip6table_filter;
struct xt_table *ip6table_mangle;
#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
struct netns_nf_frag {
- struct fqdir frags;
+ struct fqdir fqdir;
};
#endif
key.src = *src;
key.dst = *dst;
- q = inet_frag_find(&ieee802154_lowpan->frags, &key);
+ q = inet_frag_find(&ieee802154_lowpan->fqdir, &key);
if (!q)
return NULL;
static struct ctl_table lowpan_frags_ns_ctl_table[] = {
{
.procname = "6lowpanfrag_high_thresh",
- .data = &init_net.ieee802154_lowpan.frags.high_thresh,
+ .data = &init_net.ieee802154_lowpan.fqdir.high_thresh,
.maxlen = sizeof(unsigned long),
.mode = 0644,
.proc_handler = proc_doulongvec_minmax,
- .extra1 = &init_net.ieee802154_lowpan.frags.low_thresh
+ .extra1 = &init_net.ieee802154_lowpan.fqdir.low_thresh
},
{
.procname = "6lowpanfrag_low_thresh",
- .data = &init_net.ieee802154_lowpan.frags.low_thresh,
+ .data = &init_net.ieee802154_lowpan.fqdir.low_thresh,
.maxlen = sizeof(unsigned long),
.mode = 0644,
.proc_handler = proc_doulongvec_minmax,
- .extra2 = &init_net.ieee802154_lowpan.frags.high_thresh
+ .extra2 = &init_net.ieee802154_lowpan.fqdir.high_thresh
},
{
.procname = "6lowpanfrag_time",
- .data = &init_net.ieee802154_lowpan.frags.timeout,
+ .data = &init_net.ieee802154_lowpan.fqdir.timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
if (table == NULL)
goto err_alloc;
- table[0].data = &ieee802154_lowpan->frags.high_thresh;
- table[0].extra1 = &ieee802154_lowpan->frags.low_thresh;
- table[1].data = &ieee802154_lowpan->frags.low_thresh;
- table[1].extra2 = &ieee802154_lowpan->frags.high_thresh;
- table[2].data = &ieee802154_lowpan->frags.timeout;
+ table[0].data = &ieee802154_lowpan->fqdir.high_thresh;
+ table[0].extra1 = &ieee802154_lowpan->fqdir.low_thresh;
+ table[1].data = &ieee802154_lowpan->fqdir.low_thresh;
+ table[1].extra2 = &ieee802154_lowpan->fqdir.high_thresh;
+ table[2].data = &ieee802154_lowpan->fqdir.timeout;
/* Don't export sysctls to unprivileged users */
if (net->user_ns != &init_user_ns)
net_ieee802154_lowpan(net);
int res;
- ieee802154_lowpan->frags.high_thresh = IPV6_FRAG_HIGH_THRESH;
- ieee802154_lowpan->frags.low_thresh = IPV6_FRAG_LOW_THRESH;
- ieee802154_lowpan->frags.timeout = IPV6_FRAG_TIMEOUT;
- ieee802154_lowpan->frags.f = &lowpan_frags;
+ ieee802154_lowpan->fqdir.high_thresh = IPV6_FRAG_HIGH_THRESH;
+ ieee802154_lowpan->fqdir.low_thresh = IPV6_FRAG_LOW_THRESH;
+ ieee802154_lowpan->fqdir.timeout = IPV6_FRAG_TIMEOUT;
+ ieee802154_lowpan->fqdir.f = &lowpan_frags;
- res = inet_frags_init_net(&ieee802154_lowpan->frags);
+ res = inet_frags_init_net(&ieee802154_lowpan->fqdir);
if (res < 0)
return res;
res = lowpan_frags_ns_sysctl_register(net);
if (res < 0)
- fqdir_exit(&ieee802154_lowpan->frags);
+ fqdir_exit(&ieee802154_lowpan->fqdir);
return res;
}
net_ieee802154_lowpan(net);
lowpan_frags_ns_sysctl_unregister(net);
- fqdir_exit(&ieee802154_lowpan->frags);
+ fqdir_exit(&ieee802154_lowpan->fqdir);
}
static struct pernet_operations lowpan_frags_ops = {
{
struct ipq *qp = container_of(q, struct ipq, q);
struct netns_ipv4 *ipv4 = container_of(q->fqdir, struct netns_ipv4,
- frags);
+ fqdir);
struct net *net = container_of(ipv4, struct net, ipv4);
const struct frag_v4_compare_key *key = a;
int err;
qp = container_of(frag, struct ipq, q);
- net = container_of(qp->q.fqdir, struct net, ipv4.frags);
+ net = container_of(qp->q.fqdir, struct net, ipv4.fqdir);
rcu_read_lock();
spin_lock(&qp->q.lock);
};
struct inet_frag_queue *q;
- q = inet_frag_find(&net->ipv4.frags, &key);
+ q = inet_frag_find(&net->ipv4.fqdir, &key);
if (!q)
return NULL;
if (rc) {
struct net *net;
- net = container_of(qp->q.fqdir, struct net, ipv4.frags);
+ net = container_of(qp->q.fqdir, struct net, ipv4.fqdir);
__IP_INC_STATS(net, IPSTATS_MIB_REASMFAILS);
}
/* Add new segment to existing queue. */
static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
{
- struct net *net = container_of(qp->q.fqdir, struct net, ipv4.frags);
+ struct net *net = container_of(qp->q.fqdir, struct net, ipv4.fqdir);
int ihl, end, flags, offset;
struct sk_buff *prev_tail;
struct net_device *dev;
static int ip_frag_reasm(struct ipq *qp, struct sk_buff *skb,
struct sk_buff *prev_tail, struct net_device *dev)
{
- struct net *net = container_of(qp->q.fqdir, struct net, ipv4.frags);
+ struct net *net = container_of(qp->q.fqdir, struct net, ipv4.fqdir);
struct iphdr *iph;
void *reasm_data;
int len, err;
static struct ctl_table ip4_frags_ns_ctl_table[] = {
{
.procname = "ipfrag_high_thresh",
- .data = &init_net.ipv4.frags.high_thresh,
+ .data = &init_net.ipv4.fqdir.high_thresh,
.maxlen = sizeof(unsigned long),
.mode = 0644,
.proc_handler = proc_doulongvec_minmax,
- .extra1 = &init_net.ipv4.frags.low_thresh
+ .extra1 = &init_net.ipv4.fqdir.low_thresh
},
{
.procname = "ipfrag_low_thresh",
- .data = &init_net.ipv4.frags.low_thresh,
+ .data = &init_net.ipv4.fqdir.low_thresh,
.maxlen = sizeof(unsigned long),
.mode = 0644,
.proc_handler = proc_doulongvec_minmax,
- .extra2 = &init_net.ipv4.frags.high_thresh
+ .extra2 = &init_net.ipv4.fqdir.high_thresh
},
{
.procname = "ipfrag_time",
- .data = &init_net.ipv4.frags.timeout,
+ .data = &init_net.ipv4.fqdir.timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
},
{
.procname = "ipfrag_max_dist",
- .data = &init_net.ipv4.frags.max_dist,
+ .data = &init_net.ipv4.fqdir.max_dist,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
if (!table)
goto err_alloc;
- table[0].data = &net->ipv4.frags.high_thresh;
- table[0].extra1 = &net->ipv4.frags.low_thresh;
- table[1].data = &net->ipv4.frags.low_thresh;
- table[1].extra2 = &net->ipv4.frags.high_thresh;
- table[2].data = &net->ipv4.frags.timeout;
- table[3].data = &net->ipv4.frags.max_dist;
+ table[0].data = &net->ipv4.fqdir.high_thresh;
+ table[0].extra1 = &net->ipv4.fqdir.low_thresh;
+ table[1].data = &net->ipv4.fqdir.low_thresh;
+ table[1].extra2 = &net->ipv4.fqdir.high_thresh;
+ table[2].data = &net->ipv4.fqdir.timeout;
+ table[3].data = &net->ipv4.fqdir.max_dist;
}
hdr = register_net_sysctl(net, "net/ipv4", table);
* we will prune down to 3MB, making room for approx 8 big 64K
* fragments 8x128k.
*/
- net->ipv4.frags.high_thresh = 4 * 1024 * 1024;
- net->ipv4.frags.low_thresh = 3 * 1024 * 1024;
+ net->ipv4.fqdir.high_thresh = 4 * 1024 * 1024;
+ net->ipv4.fqdir.low_thresh = 3 * 1024 * 1024;
/*
* Important NOTE! Fragment queue must be destroyed before MSL expires.
* RFC791 is wrong proposing to prolongate timer each fragment arrival
* by TTL.
*/
- net->ipv4.frags.timeout = IP_FRAG_TIME;
+ net->ipv4.fqdir.timeout = IP_FRAG_TIME;
- net->ipv4.frags.max_dist = 64;
- net->ipv4.frags.f = &ip4_frags;
+ net->ipv4.fqdir.max_dist = 64;
+ net->ipv4.fqdir.f = &ip4_frags;
- res = inet_frags_init_net(&net->ipv4.frags);
+ res = inet_frags_init_net(&net->ipv4.fqdir);
if (res < 0)
return res;
res = ip4_frags_ns_ctl_register(net);
if (res < 0)
- fqdir_exit(&net->ipv4.frags);
+ fqdir_exit(&net->ipv4.fqdir);
return res;
}
static void __net_exit ipv4_frags_exit_net(struct net *net)
{
ip4_frags_ns_ctl_unregister(net);
- fqdir_exit(&net->ipv4.frags);
+ fqdir_exit(&net->ipv4.fqdir);
}
static struct pernet_operations ip4_frags_ops = {
seq_printf(seq, "RAW: inuse %d\n",
sock_prot_inuse_get(net, &raw_prot));
seq_printf(seq, "FRAG: inuse %u memory %lu\n",
- atomic_read(&net->ipv4.frags.rhashtable.nelems),
- frag_mem_limit(&net->ipv4.frags));
+ atomic_read(&net->ipv4.fqdir.rhashtable.nelems),
+ frag_mem_limit(&net->ipv4.fqdir));
return 0;
}
static struct ctl_table nf_ct_frag6_sysctl_table[] = {
{
.procname = "nf_conntrack_frag6_timeout",
- .data = &init_net.nf_frag.frags.timeout,
+ .data = &init_net.nf_frag.fqdir.timeout,
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
},
{
.procname = "nf_conntrack_frag6_low_thresh",
- .data = &init_net.nf_frag.frags.low_thresh,
+ .data = &init_net.nf_frag.fqdir.low_thresh,
.maxlen = sizeof(unsigned long),
.mode = 0644,
.proc_handler = proc_doulongvec_minmax,
- .extra2 = &init_net.nf_frag.frags.high_thresh
+ .extra2 = &init_net.nf_frag.fqdir.high_thresh
},
{
.procname = "nf_conntrack_frag6_high_thresh",
- .data = &init_net.nf_frag.frags.high_thresh,
+ .data = &init_net.nf_frag.fqdir.high_thresh,
.maxlen = sizeof(unsigned long),
.mode = 0644,
.proc_handler = proc_doulongvec_minmax,
- .extra1 = &init_net.nf_frag.frags.low_thresh
+ .extra1 = &init_net.nf_frag.fqdir.low_thresh
},
{ }
};
if (table == NULL)
goto err_alloc;
- table[0].data = &net->nf_frag.frags.timeout;
- table[1].data = &net->nf_frag.frags.low_thresh;
- table[1].extra2 = &net->nf_frag.frags.high_thresh;
- table[2].data = &net->nf_frag.frags.high_thresh;
- table[2].extra1 = &net->nf_frag.frags.low_thresh;
- table[2].extra2 = &init_net.nf_frag.frags.high_thresh;
+ table[0].data = &net->nf_frag.fqdir.timeout;
+ table[1].data = &net->nf_frag.fqdir.low_thresh;
+ table[1].extra2 = &net->nf_frag.fqdir.high_thresh;
+ table[2].data = &net->nf_frag.fqdir.high_thresh;
+ table[2].extra1 = &net->nf_frag.fqdir.low_thresh;
+ table[2].extra2 = &init_net.nf_frag.fqdir.high_thresh;
}
hdr = register_net_sysctl(net, "net/netfilter", table);
struct net *net;
fq = container_of(frag, struct frag_queue, q);
- net = container_of(fq->q.fqdir, struct net, nf_frag.frags);
+ net = container_of(fq->q.fqdir, struct net, nf_frag.fqdir);
ip6frag_expire_frag_queue(net, fq);
}
};
struct inet_frag_queue *q;
- q = inet_frag_find(&net->nf_frag.frags, &key);
+ q = inet_frag_find(&net->nf_frag.fqdir, &key);
if (!q)
return NULL;
{
int res;
- net->nf_frag.frags.high_thresh = IPV6_FRAG_HIGH_THRESH;
- net->nf_frag.frags.low_thresh = IPV6_FRAG_LOW_THRESH;
- net->nf_frag.frags.timeout = IPV6_FRAG_TIMEOUT;
- net->nf_frag.frags.f = &nf_frags;
+ net->nf_frag.fqdir.high_thresh = IPV6_FRAG_HIGH_THRESH;
+ net->nf_frag.fqdir.low_thresh = IPV6_FRAG_LOW_THRESH;
+ net->nf_frag.fqdir.timeout = IPV6_FRAG_TIMEOUT;
+ net->nf_frag.fqdir.f = &nf_frags;
- res = inet_frags_init_net(&net->nf_frag.frags);
+ res = inet_frags_init_net(&net->nf_frag.fqdir);
if (res < 0)
return res;
res = nf_ct_frag6_sysctl_register(net);
if (res < 0)
- fqdir_exit(&net->nf_frag.frags);
+ fqdir_exit(&net->nf_frag.fqdir);
return res;
}
static void nf_ct_net_exit(struct net *net)
{
nf_ct_frags6_sysctl_unregister(net);
- fqdir_exit(&net->nf_frag.frags);
+ fqdir_exit(&net->nf_frag.fqdir);
}
static struct pernet_operations nf_ct_net_ops = {
seq_printf(seq, "RAW6: inuse %d\n",
sock_prot_inuse_get(net, &rawv6_prot));
seq_printf(seq, "FRAG6: inuse %u memory %lu\n",
- atomic_read(&net->ipv6.frags.rhashtable.nelems),
- frag_mem_limit(&net->ipv6.frags));
+ atomic_read(&net->ipv6.fqdir.rhashtable.nelems),
+ frag_mem_limit(&net->ipv6.fqdir));
return 0;
}
struct net *net;
fq = container_of(frag, struct frag_queue, q);
- net = container_of(fq->q.fqdir, struct net, ipv6.frags);
+ net = container_of(fq->q.fqdir, struct net, ipv6.fqdir);
ip6frag_expire_frag_queue(net, fq);
}
IPV6_ADDR_LINKLOCAL)))
key.iif = 0;
- q = inet_frag_find(&net->ipv6.frags, &key);
+ q = inet_frag_find(&net->ipv6.fqdir, &key);
if (!q)
return NULL;
static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *skb,
struct sk_buff *prev_tail, struct net_device *dev)
{
- struct net *net = container_of(fq->q.fqdir, struct net, ipv6.frags);
+ struct net *net = container_of(fq->q.fqdir, struct net, ipv6.fqdir);
unsigned int nhoff;
void *reasm_data;
int payload_len;
static struct ctl_table ip6_frags_ns_ctl_table[] = {
{
.procname = "ip6frag_high_thresh",
- .data = &init_net.ipv6.frags.high_thresh,
+ .data = &init_net.ipv6.fqdir.high_thresh,
.maxlen = sizeof(unsigned long),
.mode = 0644,
.proc_handler = proc_doulongvec_minmax,
- .extra1 = &init_net.ipv6.frags.low_thresh
+ .extra1 = &init_net.ipv6.fqdir.low_thresh
},
{
.procname = "ip6frag_low_thresh",
- .data = &init_net.ipv6.frags.low_thresh,
+ .data = &init_net.ipv6.fqdir.low_thresh,
.maxlen = sizeof(unsigned long),
.mode = 0644,
.proc_handler = proc_doulongvec_minmax,
- .extra2 = &init_net.ipv6.frags.high_thresh
+ .extra2 = &init_net.ipv6.fqdir.high_thresh
},
{
.procname = "ip6frag_time",
- .data = &init_net.ipv6.frags.timeout,
+ .data = &init_net.ipv6.fqdir.timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
if (!table)
goto err_alloc;
- table[0].data = &net->ipv6.frags.high_thresh;
- table[0].extra1 = &net->ipv6.frags.low_thresh;
- table[1].data = &net->ipv6.frags.low_thresh;
- table[1].extra2 = &net->ipv6.frags.high_thresh;
- table[2].data = &net->ipv6.frags.timeout;
+ table[0].data = &net->ipv6.fqdir.high_thresh;
+ table[0].extra1 = &net->ipv6.fqdir.low_thresh;
+ table[1].data = &net->ipv6.fqdir.low_thresh;
+ table[1].extra2 = &net->ipv6.fqdir.high_thresh;
+ table[2].data = &net->ipv6.fqdir.timeout;
}
hdr = register_net_sysctl(net, "net/ipv6", table);
{
int res;
- net->ipv6.frags.high_thresh = IPV6_FRAG_HIGH_THRESH;
- net->ipv6.frags.low_thresh = IPV6_FRAG_LOW_THRESH;
- net->ipv6.frags.timeout = IPV6_FRAG_TIMEOUT;
- net->ipv6.frags.f = &ip6_frags;
+ net->ipv6.fqdir.high_thresh = IPV6_FRAG_HIGH_THRESH;
+ net->ipv6.fqdir.low_thresh = IPV6_FRAG_LOW_THRESH;
+ net->ipv6.fqdir.timeout = IPV6_FRAG_TIMEOUT;
+ net->ipv6.fqdir.f = &ip6_frags;
- res = inet_frags_init_net(&net->ipv6.frags);
+ res = inet_frags_init_net(&net->ipv6.fqdir);
if (res < 0)
return res;
res = ip6_frags_ns_sysctl_register(net);
if (res < 0)
- fqdir_exit(&net->ipv6.frags);
+ fqdir_exit(&net->ipv6.fqdir);
return res;
}
static void __net_exit ipv6_frags_exit_net(struct net *net)
{
ip6_frags_ns_sysctl_unregister(net);
- fqdir_exit(&net->ipv6.frags);
+ fqdir_exit(&net->ipv6.fqdir);
}
static struct pernet_operations ip6_frags_ops = {