Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 803fdd99 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

net: rename struct fqdir fields



Rename the @frags fields from structs netns_ipv4, netns_ipv6,
netns_nf_frag and netns_ieee802154_lowpan to @fqdir

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 89fb9005
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ struct netns_sysctl_lowpan {

struct netns_ieee802154_lowpan {
	struct netns_sysctl_lowpan sysctl;
	struct fqdir	frags;
	struct fqdir		fqdir;
};

#endif
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ struct netns_ipv4 {

	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;
+2 −2
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ struct netns_ipv6 {
	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;
@@ -116,7 +116,7 @@ struct netns_ipv6 {

#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
struct netns_nf_frag {
	struct fqdir	frags;
	struct fqdir	fqdir;
};
#endif

+18 −18
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ fq_find(struct net *net, const struct lowpan_802154_cb *cb,
	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;

@@ -326,23 +326,23 @@ int lowpan_frag_rcv(struct sk_buff *skb, u8 frag_type)
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,
@@ -377,11 +377,11 @@ static int __net_init lowpan_frags_ns_sysctl_register(struct net *net)
		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)
@@ -454,17 +454,17 @@ static int __net_init lowpan_frags_init_net(struct net *net)
		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;
}

@@ -474,7 +474,7 @@ static void __net_exit lowpan_frags_exit_net(struct net *net)
		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 = {
+26 −26
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ static void ip4_frag_init(struct inet_frag_queue *q, const void *a)
{
	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;
@@ -142,7 +142,7 @@ static void ip_expire(struct timer_list *t)
	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);
@@ -211,7 +211,7 @@ static struct ipq *ip_find(struct net *net, struct iphdr *iph,
	};
	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;

@@ -239,7 +239,7 @@ static int ip_frag_too_far(struct ipq *qp)
	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);
	}

@@ -273,7 +273,7 @@ static int ip_frag_reinit(struct ipq *qp)
/* 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;
@@ -399,7 +399,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
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;
@@ -544,30 +544,30 @@ static int dist_min;
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,
@@ -600,12 +600,12 @@ static int __net_init ip4_frags_ns_ctl_register(struct net *net)
		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);
@@ -668,31 +668,31 @@ static int __net_init ipv4_frags_init_net(struct net *net)
	 * 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 = {
Loading