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

Commit 686c9b50 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Pablo Neira Ayuso
Browse files

netfilter: x_tables: Use par->net instead of computing from the passed net devices

parent 156c196f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ ebt_log_tg(struct sk_buff *skb, const struct xt_action_param *par)
{
	const struct ebt_log_info *info = par->targinfo;
	struct nf_loginfo li;
	struct net *net = dev_net(par->in ? par->in : par->out);
	struct net *net = par->net;

	li.type = NF_LOG_TYPE_LOG;
	li.u.log.level = info->loglevel;
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ ebt_nflog_tg(struct sk_buff *skb, const struct xt_action_param *par)
{
	const struct ebt_nflog_info *info = par->targinfo;
	struct nf_loginfo li;
	struct net *net = dev_net(par->in ? par->in : par->out);
	struct net *net = par->net;

	li.type = NF_LOG_TYPE_ULOG;
	li.u.ulog.copy_len = info->len;
+1 −1
Original line number Diff line number Diff line
@@ -258,7 +258,7 @@ static unsigned int
synproxy_tg4(struct sk_buff *skb, const struct xt_action_param *par)
{
	const struct xt_synproxy_info *info = par->targinfo;
	struct synproxy_net *snet = synproxy_pernet(dev_net(par->in));
	struct synproxy_net *snet = synproxy_pernet(par->net);
	struct synproxy_options opts = {};
	struct tcphdr *th, _th;

+2 −3
Original line number Diff line number Diff line
@@ -32,12 +32,11 @@ static __be32 rpfilter_get_saddr(__be32 addr)
	return addr;
}

static bool rpfilter_lookup_reverse(struct flowi4 *fl4,
static bool rpfilter_lookup_reverse(struct net *net, struct flowi4 *fl4,
				const struct net_device *dev, u8 flags)
{
	struct fib_result res;
	bool dev_match;
	struct net *net = dev_net(dev);
	int ret __maybe_unused;

	if (fib_lookup(net, fl4, &res, FIB_LOOKUP_IGNORE_LINKSTATE))
@@ -98,7 +97,7 @@ static bool rpfilter_mt(const struct sk_buff *skb, struct xt_action_param *par)
	flow.flowi4_tos = RT_TOS(iph->tos);
	flow.flowi4_scope = RT_SCOPE_UNIVERSE;

	return rpfilter_lookup_reverse(&flow, par->in, info->flags) ^ invert;
	return rpfilter_lookup_reverse(par->net, &flow, par->in, info->flags) ^ invert;
}

static int rpfilter_check(const struct xt_mtchk_param *par)
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ static unsigned int
reject_tg6(struct sk_buff *skb, const struct xt_action_param *par)
{
	const struct ip6t_reject_info *reject = par->targinfo;
	struct net *net = dev_net((par->in != NULL) ? par->in : par->out);
	struct net *net = par->net;

	switch (reject->with) {
	case IP6T_ICMP6_NO_ROUTE:
Loading