Re: [PATCH v13 nf-next 1/3] netfilter: utils: nf_checksum(_partial) correct data!=networkheader
From: kernel test robot <hidden>
Date: 2025-07-05 17:34:25
Also in:
bridge, netfilter-devel, oe-kbuild-all
Hi Eric, kernel test robot noticed the following build warnings: [auto build test WARNING on netfilter-nf/main] [also build test WARNING on horms-ipvs/master linus/master v6.16-rc4 next-20250704] [cannot apply to nf-next/master] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Eric-Woudstra/netfilter-utils-nf_checksum-_partial-correct-data-networkheader/20250705-031418 base: https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git main patch link: https://lore.kernel.org/r/20250704191135.1815969-2-ericwouds%40gmail.com patch subject: [PATCH v13 nf-next 1/3] netfilter: utils: nf_checksum(_partial) correct data!=networkheader config: x86_64-randconfig-121-20250705 (https://download.01.org/0day-ci/archive/20250706/202507060106.A5xgr1Rs-lkp@intel.com/config) compiler: clang version 20.1.7 (https://github.com/llvm/llvm-project 6146a88f60492b520a36f8f8f3231e15f3cc6082) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250706/202507060106.A5xgr1Rs-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 [off-list ref] | Closes: https://lore.kernel.org/oe-kbuild-all/202507060106.A5xgr1Rs-lkp@intel.com/ (local) sparse warnings: (new ones prefixed by >>)
quoted
net/netfilter/utils.c:131:24: sparse: sparse: incorrect type in return expression (different base types) @@ expected restricted __sum16 @@ got int @@
net/netfilter/utils.c:131:24: sparse: expected restricted __sum16
net/netfilter/utils.c:131:24: sparse: got int
net/netfilter/utils.c:155:24: sparse: sparse: incorrect type in return expression (different base types) @@ expected restricted __sum16 @@ got int @@
net/netfilter/utils.c:155:24: sparse: expected restricted __sum16
net/netfilter/utils.c:155:24: sparse: got int
vim +131 net/netfilter/utils.c
122
123 __sum16 nf_checksum(struct sk_buff *skb, unsigned int hook,
124 unsigned int dataoff, u8 protocol,
125 unsigned short family)
126 {
127 unsigned int nhpull = skb_network_header(skb) - skb->data;
128 __sum16 csum = 0;
129
130 if (!pskb_may_pull(skb, nhpull))
> 131 return -ENOMEM;
132 __skb_pull(skb, nhpull);
133 switch (family) {
134 case AF_INET:
135 csum = nf_ip_checksum(skb, hook, dataoff - nhpull, protocol);
136 break;
137 case AF_INET6:
138 csum = nf_ip6_checksum(skb, hook, dataoff - nhpull, protocol);
139 break;
140 }
141 __skb_push(skb, nhpull);
142
143 return csum;
144 }
145 EXPORT_SYMBOL_GPL(nf_checksum);
146
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki