Re: [PATCH nf-next 3/4] netfilter: add inet ingress support

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

 



Hi Pablo,

I love your patch! Yet something to improve:

[auto build test ERROR on nf-next/master]

url:    https://github.com/0day-ci/linux/commits/Pablo-Neira-Ayuso/Add-nf_tables-ingress-hook-for-the-inet-family/20201008-071530
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git master
config: x86_64-randconfig-s022-20201008 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-218-gc0e96d6d-dirty
        # https://github.com/0day-ci/linux/commit/4a788f545ac2e08b0c08658e156da55e2fce5ae6
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Pablo-Neira-Ayuso/Add-nf_tables-ingress-hook-for-the-inet-family/20201008-071530
        git checkout 4a788f545ac2e08b0c08658e156da55e2fce5ae6
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

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

All error/warnings (new ones prefixed by >>):

   net/netfilter/core.c: In function 'nf_hook_entry_head':
>> net/netfilter/core.c:292:14: error: 'struct net_device' has no member named 'nf_hooks_ingress'
     292 |   return &dev->nf_hooks_ingress;
         |              ^~
>> net/netfilter/core.c:288:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
     288 |   if (!dev || dev_net(dev) != net) {
         |       ~~~~~^~~~~~~~~~~~~~~~~~~~~~
   net/netfilter/core.c:293:2: note: here
     293 |  case NFPROTO_IPV4:
         |  ^~~~
   At top level:
   net/netfilter/core.c:336:13: warning: 'nf_ingress_hook' defined but not used [-Wunused-function]
     336 | static bool nf_ingress_hook(const struct nf_hook_ops *reg, int pf)
         |             ^~~~~~~~~~~~~~~

vim +292 net/netfilter/core.c

   265	
   266	static struct nf_hook_entries __rcu **
   267	nf_hook_entry_head(struct net *net, int pf, unsigned int hooknum,
   268			   struct net_device *dev)
   269	{
   270		switch (pf) {
   271		case NFPROTO_NETDEV:
   272			break;
   273	#ifdef CONFIG_NETFILTER_FAMILY_ARP
   274		case NFPROTO_ARP:
   275			if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_arp) <= hooknum))
   276				return NULL;
   277			return net->nf.hooks_arp + hooknum;
   278	#endif
   279	#ifdef CONFIG_NETFILTER_FAMILY_BRIDGE
   280		case NFPROTO_BRIDGE:
   281			if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_bridge) <= hooknum))
   282				return NULL;
   283			return net->nf.hooks_bridge + hooknum;
   284	#endif
   285		case NFPROTO_INET:
   286			if (WARN_ON_ONCE(hooknum != NF_INET_INGRESS))
   287				return NULL;
 > 288			if (!dev || dev_net(dev) != net) {
   289				WARN_ON_ONCE(1);
   290				return NULL;
   291			}
 > 292			return &dev->nf_hooks_ingress;
   293		case NFPROTO_IPV4:
   294			if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_ipv4) <= hooknum))
   295				return NULL;
   296			return net->nf.hooks_ipv4 + hooknum;
   297		case NFPROTO_IPV6:
   298			if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_ipv6) <= hooknum))
   299				return NULL;
   300			return net->nf.hooks_ipv6 + hooknum;
   301	#if IS_ENABLED(CONFIG_DECNET)
   302		case NFPROTO_DECNET:
   303			if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_decnet) <= hooknum))
   304				return NULL;
   305			return net->nf.hooks_decnet + hooknum;
   306	#endif
   307		default:
   308			WARN_ON_ONCE(1);
   309			return NULL;
   310		}
   311	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


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

  Powered by Linux