From: kernel test robot <lkp@intel.com>
To: Florian Westphal <fw@strlen.de>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org
Subject: [nf-next:testing 4/5] net/netfilter/nf_nat_masquerade.c:273:6: warning: variable 'ret' is uninitialized when used here
Date: Sun, 22 Sep 2024 11:41:20 +0800 [thread overview]
Message-ID: <202409221130.jIDto0hf-lkp@intel.com> (raw)
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: arm-aspeed_g4_defconfig (https://download.01.org/0day-ci/archive/20240922/202409221130.jIDto0hf-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 8663a75fa2f31299ab8d1d90288d9df92aadee88)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240922/202409221130.jIDto0hf-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/202409221130.jIDto0hf-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from net/netfilter/nf_nat_masquerade.c:5:
In file included from include/linux/inetdevice.h:9:
In file included from include/linux/ip.h:16:
In file included from include/linux/skbuff.h:17:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:8:
In file included from include/linux/cacheflush.h:5:
In file included from arch/arm/include/asm/cacheflush.h:10:
In file included from include/linux/mm.h:2232:
include/linux/vmstat.h:517:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
517 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> net/netfilter/nf_nat_masquerade.c:273:6: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
273 | if (ret == NF_DROP)
| ^~~
net/netfilter/nf_nat_masquerade.c:253:9: note: initialize the variable 'ret' to silence this warning
253 | int ret;
| ^
| = 0
2 warnings generated.
vim +/ret +273 net/netfilter/nf_nat_masquerade.c
243
244 unsigned int
245 nf_nat_masquerade_ipv6(struct sk_buff *skb, const struct nf_nat_range2 *range,
246 const struct net_device *out)
247 {
248 enum ip_conntrack_info ctinfo;
249 struct nf_conn_nat *nat;
250 struct in6_addr src;
251 struct nf_conn *ct;
252 struct nf_nat_range2 newrange;
253 int ret;
254
255 ct = nf_ct_get(skb, &ctinfo);
256 WARN_ON(!(ct && (ctinfo == IP_CT_NEW || ctinfo == IP_CT_RELATED ||
257 ctinfo == IP_CT_RELATED_REPLY)));
258
259 if (nat_ipv6_dev_get_saddr(nf_ct_net(ct), out,
260 &ipv6_hdr(skb)->daddr, 0, &src) < 0)
261 return NF_DROP_REASON(skb, SKB_DROP_REASON_NETFILTER_DROP, EADDRNOTAVAIL);
262
263 nat = nf_ct_nat_ext_add(ct);
264 if (nat)
265 nat->masq_index = out->ifindex;
266
267 newrange.flags = range->flags | NF_NAT_RANGE_MAP_IPS;
268 newrange.min_addr.in6 = src;
269 newrange.max_addr.in6 = src;
270 newrange.min_proto = range->min_proto;
271 newrange.max_proto = range->max_proto;
272
> 273 if (ret == NF_DROP)
274 return NF_DROP_REASON(skb, SKB_DROP_REASON_NETFILTER_DROP, EPERM);
275
276 return ret;
277 }
278 EXPORT_SYMBOL_GPL(nf_nat_masquerade_ipv6);
279
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-09-22 3:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202409221130.jIDto0hf-lkp@intel.com \
--to=lkp@intel.com \
--cc=coreteam@netfilter.org \
--cc=fw@strlen.de \
--cc=llvm@lists.linux.dev \
--cc=netfilter-devel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox