Re: [PATCH v3] netfilter: nft_meta: support for time matching

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

 



Hi Ander,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.3-rc3 next-20190807]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Ander-Juaristi/netfilter-nft_meta-support-for-time-matching/20190804-141253
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-rc1-7-g2b96cd8-dirty
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

   include/linux/sched.h:609:43: sparse: sparse: bad integer constant expression
   include/linux/sched.h:609:73: sparse: sparse: invalid named zero-width bitfield `value'
   include/linux/sched.h:610:43: sparse: sparse: bad integer constant expression
   include/linux/sched.h:610:67: sparse: sparse: invalid named zero-width bitfield `bucket_id'
   net/bridge/netfilter/nft_meta_bridge.c:41:14: sparse: sparse: undefined identifier 'NFT_META_BRI_IIFPVID'
   net/bridge/netfilter/nft_meta_bridge.c:52:14: sparse: sparse: undefined identifier 'NFT_META_BRI_IIFVPROTO'
>> net/bridge/netfilter/nft_meta_bridge.c:41:14: sparse: sparse: incompatible types for 'case' statement
   net/bridge/netfilter/nft_meta_bridge.c:52:14: sparse: sparse: incompatible types for 'case' statement
   net/bridge/netfilter/nft_meta_bridge.c:88:14: sparse: sparse: undefined identifier 'NFT_META_BRI_IIFPVID'
   net/bridge/netfilter/nft_meta_bridge.c:89:14: sparse: sparse: undefined identifier 'NFT_META_BRI_IIFVPROTO'
   net/bridge/netfilter/nft_meta_bridge.c:88:14: sparse: sparse: incompatible types for 'case' statement
   net/bridge/netfilter/nft_meta_bridge.c:89:14: sparse: sparse: incompatible types for 'case' statement
   net/bridge/netfilter/nft_meta_bridge.c:41:14: sparse: sparse: Expected constant expression in case statement
   net/bridge/netfilter/nft_meta_bridge.c:52:14: sparse: sparse: Expected constant expression in case statement
   net/bridge/netfilter/nft_meta_bridge.c:88:14: sparse: sparse: Expected constant expression in case statement
   net/bridge/netfilter/nft_meta_bridge.c:89:14: sparse: sparse: Expected constant expression in case statement

vim +/case +41 net/bridge/netfilter/nft_meta_bridge.c

30e103fe24debc wenxu 2019-07-05  20  
30e103fe24debc wenxu 2019-07-05  21  static void nft_meta_bridge_get_eval(const struct nft_expr *expr,
30e103fe24debc wenxu 2019-07-05  22  				     struct nft_regs *regs,
30e103fe24debc wenxu 2019-07-05  23  				     const struct nft_pktinfo *pkt)
30e103fe24debc wenxu 2019-07-05  24  {
30e103fe24debc wenxu 2019-07-05  25  	const struct nft_meta *priv = nft_expr_priv(expr);
30e103fe24debc wenxu 2019-07-05  26  	const struct net_device *in = nft_in(pkt), *out = nft_out(pkt);
30e103fe24debc wenxu 2019-07-05  27  	u32 *dest = &regs->data[priv->dreg];
9d6a1ecdc99717 wenxu 2019-07-05  28  	const struct net_device *br_dev;
30e103fe24debc wenxu 2019-07-05  29  
30e103fe24debc wenxu 2019-07-05  30  	switch (priv->key) {
30e103fe24debc wenxu 2019-07-05  31  	case NFT_META_BRI_IIFNAME:
9d6a1ecdc99717 wenxu 2019-07-05  32  		br_dev = nft_meta_get_bridge(in);
9d6a1ecdc99717 wenxu 2019-07-05  33  		if (!br_dev)
30e103fe24debc wenxu 2019-07-05  34  			goto err;
30e103fe24debc wenxu 2019-07-05  35  		break;
30e103fe24debc wenxu 2019-07-05  36  	case NFT_META_BRI_OIFNAME:
9d6a1ecdc99717 wenxu 2019-07-05  37  		br_dev = nft_meta_get_bridge(out);
9d6a1ecdc99717 wenxu 2019-07-05  38  		if (!br_dev)
30e103fe24debc wenxu 2019-07-05  39  			goto err;
30e103fe24debc wenxu 2019-07-05  40  		break;
c54c7c685494fc wenxu 2019-07-05 @41  	case NFT_META_BRI_IIFPVID: {
c54c7c685494fc wenxu 2019-07-05  42  		u16 p_pvid;
c54c7c685494fc wenxu 2019-07-05  43  
c54c7c685494fc wenxu 2019-07-05  44  		br_dev = nft_meta_get_bridge(in);
c54c7c685494fc wenxu 2019-07-05  45  		if (!br_dev || !br_vlan_enabled(br_dev))
c54c7c685494fc wenxu 2019-07-05  46  			goto err;
c54c7c685494fc wenxu 2019-07-05  47  
c54c7c685494fc wenxu 2019-07-05  48  		br_vlan_get_pvid_rcu(in, &p_pvid);
c54c7c685494fc wenxu 2019-07-05  49  		nft_reg_store16(dest, p_pvid);
c54c7c685494fc wenxu 2019-07-05  50  		return;
c54c7c685494fc wenxu 2019-07-05  51  	}
2a3a93ef0ba516 wenxu 2019-07-05  52  	case NFT_META_BRI_IIFVPROTO: {
2a3a93ef0ba516 wenxu 2019-07-05  53  		u16 p_proto;
2a3a93ef0ba516 wenxu 2019-07-05  54  
2a3a93ef0ba516 wenxu 2019-07-05  55  		br_dev = nft_meta_get_bridge(in);
2a3a93ef0ba516 wenxu 2019-07-05  56  		if (!br_dev || !br_vlan_enabled(br_dev))
2a3a93ef0ba516 wenxu 2019-07-05  57  			goto err;
2a3a93ef0ba516 wenxu 2019-07-05  58  
2a3a93ef0ba516 wenxu 2019-07-05  59  		br_vlan_get_proto(br_dev, &p_proto);
2a3a93ef0ba516 wenxu 2019-07-05  60  		nft_reg_store16(dest, p_proto);
2a3a93ef0ba516 wenxu 2019-07-05  61  		return;
2a3a93ef0ba516 wenxu 2019-07-05  62  	}
30e103fe24debc wenxu 2019-07-05  63  	default:
30e103fe24debc wenxu 2019-07-05  64  		goto out;
30e103fe24debc wenxu 2019-07-05  65  	}
30e103fe24debc wenxu 2019-07-05  66  
9d6a1ecdc99717 wenxu 2019-07-05  67  	strncpy((char *)dest, br_dev->name, IFNAMSIZ);
30e103fe24debc wenxu 2019-07-05  68  	return;
30e103fe24debc wenxu 2019-07-05  69  out:
30e103fe24debc wenxu 2019-07-05  70  	return nft_meta_get_eval(expr, regs, pkt);
30e103fe24debc wenxu 2019-07-05  71  err:
30e103fe24debc wenxu 2019-07-05  72  	regs->verdict.code = NFT_BREAK;
30e103fe24debc wenxu 2019-07-05  73  }
30e103fe24debc wenxu 2019-07-05  74  

:::::: The code at line 41 was first introduced by commit
:::::: c54c7c685494fc0f1662091d4d0c4fc26e810471 netfilter: nft_meta_bridge: add NFT_META_BRI_IIFPVID support

:::::: TO: wenxu <wenxu@xxxxxxxxx>
:::::: CC: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



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

  Powered by Linux