* [nf-next:testing 4/5] net/netfilter/nf_nat_masquerade.c:252:30: warning: variable 'newrange' set but not used
@ 2024-09-21 19:51 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-09-21 19:51 UTC (permalink / raw)
To: Florian Westphal; +Cc: oe-kbuild-all, netfilter-devel, coreteam
tree: https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next.git testing
head: eb5a3496084f9a3ea3fb4c4d22b4c661d46a2743
commit: ecc701a3bd9890f83ea89337c64d4f14aba9f091 [4/5] netfilter: nf_nat: use skb_drop_reason
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20240922/202409220325.Fe1kvl39-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240922/202409220325.Fe1kvl39-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409220325.Fe1kvl39-lkp@intel.com/
All warnings (new ones prefixed by >>):
net/netfilter/nf_nat_masquerade.c: In function 'nf_nat_masquerade_ipv6':
>> net/netfilter/nf_nat_masquerade.c:252:30: warning: variable 'newrange' set but not used [-Wunused-but-set-variable]
252 | struct nf_nat_range2 newrange;
| ^~~~~~~~
vim +/newrange +252 net/netfilter/nf_nat_masquerade.c
d1aca8ab3104aa Florian Westphal 2019-02-19 243
d1aca8ab3104aa Florian Westphal 2019-02-19 244 unsigned int
d1aca8ab3104aa Florian Westphal 2019-02-19 245 nf_nat_masquerade_ipv6(struct sk_buff *skb, const struct nf_nat_range2 *range,
d1aca8ab3104aa Florian Westphal 2019-02-19 246 const struct net_device *out)
d1aca8ab3104aa Florian Westphal 2019-02-19 247 {
d1aca8ab3104aa Florian Westphal 2019-02-19 248 enum ip_conntrack_info ctinfo;
d1aca8ab3104aa Florian Westphal 2019-02-19 249 struct nf_conn_nat *nat;
d1aca8ab3104aa Florian Westphal 2019-02-19 250 struct in6_addr src;
d1aca8ab3104aa Florian Westphal 2019-02-19 251 struct nf_conn *ct;
d1aca8ab3104aa Florian Westphal 2019-02-19 @252 struct nf_nat_range2 newrange;
ecc701a3bd9890 Florian Westphal 2023-05-14 253 int ret;
d1aca8ab3104aa Florian Westphal 2019-02-19 254
d1aca8ab3104aa Florian Westphal 2019-02-19 255 ct = nf_ct_get(skb, &ctinfo);
d1aca8ab3104aa Florian Westphal 2019-02-19 256 WARN_ON(!(ct && (ctinfo == IP_CT_NEW || ctinfo == IP_CT_RELATED ||
d1aca8ab3104aa Florian Westphal 2019-02-19 257 ctinfo == IP_CT_RELATED_REPLY)));
d1aca8ab3104aa Florian Westphal 2019-02-19 258
d1aca8ab3104aa Florian Westphal 2019-02-19 259 if (nat_ipv6_dev_get_saddr(nf_ct_net(ct), out,
d1aca8ab3104aa Florian Westphal 2019-02-19 260 &ipv6_hdr(skb)->daddr, 0, &src) < 0)
ecc701a3bd9890 Florian Westphal 2023-05-14 261 return NF_DROP_REASON(skb, SKB_DROP_REASON_NETFILTER_DROP, EADDRNOTAVAIL);
d1aca8ab3104aa Florian Westphal 2019-02-19 262
d1aca8ab3104aa Florian Westphal 2019-02-19 263 nat = nf_ct_nat_ext_add(ct);
d1aca8ab3104aa Florian Westphal 2019-02-19 264 if (nat)
d1aca8ab3104aa Florian Westphal 2019-02-19 265 nat->masq_index = out->ifindex;
d1aca8ab3104aa Florian Westphal 2019-02-19 266
d1aca8ab3104aa Florian Westphal 2019-02-19 267 newrange.flags = range->flags | NF_NAT_RANGE_MAP_IPS;
d1aca8ab3104aa Florian Westphal 2019-02-19 268 newrange.min_addr.in6 = src;
d1aca8ab3104aa Florian Westphal 2019-02-19 269 newrange.max_addr.in6 = src;
d1aca8ab3104aa Florian Westphal 2019-02-19 270 newrange.min_proto = range->min_proto;
d1aca8ab3104aa Florian Westphal 2019-02-19 271 newrange.max_proto = range->max_proto;
d1aca8ab3104aa Florian Westphal 2019-02-19 272
ecc701a3bd9890 Florian Westphal 2023-05-14 273 if (ret == NF_DROP)
ecc701a3bd9890 Florian Westphal 2023-05-14 274 return NF_DROP_REASON(skb, SKB_DROP_REASON_NETFILTER_DROP, EPERM);
ecc701a3bd9890 Florian Westphal 2023-05-14 275
ecc701a3bd9890 Florian Westphal 2023-05-14 276 return ret;
d1aca8ab3104aa Florian Westphal 2019-02-19 277 }
d1aca8ab3104aa Florian Westphal 2019-02-19 278 EXPORT_SYMBOL_GPL(nf_nat_masquerade_ipv6);
d1aca8ab3104aa Florian Westphal 2019-02-19 279
:::::: The code at line 252 was first introduced by commit
:::::: d1aca8ab3104aa7131f5ab144c6f586b54df084b netfilter: nat: merge ipv4 and ipv6 masquerade functionality
:::::: TO: Florian Westphal <fw@strlen.de>
:::::: CC: Pablo Neira Ayuso <pablo@netfilter.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-09-21 19:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-21 19:51 [nf-next:testing 4/5] net/netfilter/nf_nat_masquerade.c:252:30: warning: variable 'newrange' set but not used kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).