Re: [PATCH nf-next 2/2] netfilter: nft_payload: skbuff vlan metadata mangle support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Pablo,

kernel test robot noticed the following build warnings:

[auto build test WARNING on netfilter-nf/main]
[also build test WARNING on linus/master v6.9-rc7 next-20240510]
[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/Pablo-Neira-Ayuso/netfilter-nft_payload-restore-vlan-q-in-q-match-support/20240510-080839
base:   git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git main
patch link:    https://lore.kernel.org/r/20240510000719.3205-3-pablo%40netfilter.org
patch subject: [PATCH nf-next 2/2] netfilter: nft_payload: skbuff vlan metadata mangle support
config: powerpc64-randconfig-r133-20240510 (https://download.01.org/0day-ci/archive/20240510/202405102106.cxYkCzFw-lkp@xxxxxxxxx/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240510/202405102106.cxYkCzFw-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405102106.cxYkCzFw-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> net/netfilter/nft_payload.c:826:36: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [usertype] vlan_proto @@     got unsigned short @@
   net/netfilter/nft_payload.c:826:36: sparse:     expected restricted __be16 [usertype] vlan_proto
   net/netfilter/nft_payload.c:826:36: sparse:     got unsigned short
>> net/netfilter/nft_payload.c:840:28: sparse: sparse: cast to restricted __be16
>> net/netfilter/nft_payload.c:840:26: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [usertype] vlan_tci @@     got unsigned short [usertype] @@
   net/netfilter/nft_payload.c:840:26: sparse:     expected restricted __be16 [usertype] vlan_tci
   net/netfilter/nft_payload.c:840:26: sparse:     got unsigned short [usertype]
>> net/netfilter/nft_payload.c:841:31: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] vlan_tci @@     got restricted __be16 [usertype] vlan_tci @@
   net/netfilter/nft_payload.c:841:31: sparse:     expected unsigned short [usertype] vlan_tci
   net/netfilter/nft_payload.c:841:31: sparse:     got restricted __be16 [usertype] vlan_tci

vim +826 net/netfilter/nft_payload.c

   809	
   810	static bool
   811	nft_payload_set_vlan(const u32 *src, struct sk_buff *skb, u8 offset, u8 len,
   812			     int *vlan_hlen)
   813	{
   814		struct nft_payload_vlan_hdr *vlanh;
   815		__be16 vlan_proto;
   816		__be16 vlan_tci;
   817	
   818		if (offset >= offsetof(struct vlan_ethhdr, h_vlan_encapsulated_proto)) {
   819			*vlan_hlen = VLAN_HLEN;
   820			return true;
   821		}
   822	
   823		switch (offset) {
   824		case offsetof(struct vlan_ethhdr, h_vlan_proto):
   825			if (len == 2) {
 > 826				vlan_proto = nft_reg_load16(src);
   827				skb->vlan_proto = vlan_proto;
   828			} else if (len == 4) {
   829				vlanh = (struct nft_payload_vlan_hdr *)src;
   830				__vlan_hwaccel_put_tag(skb, vlanh->h_vlan_proto,
   831						       ntohs(vlanh->h_vlan_TCI));
   832			} else {
   833				return false;
   834			}
   835			break;
   836		case offsetof(struct vlan_ethhdr, h_vlan_TCI):
   837			if (len != 2)
   838				return false;
   839	
 > 840			vlan_tci = ntohs(nft_reg_load16(src));
 > 841			skb->vlan_tci = vlan_tci;
   842			break;
   843		default:
   844			return false;
   845		}
   846	
   847		return true;
   848	}
   849	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux