The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [netfilter-nf-next:testing 6/11] net/netfilter/nf_nat_proto.c:721:25: warning: unused variable 'skb'
@ 2022-05-27  7:03 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-05-27  7:03 UTC (permalink / raw)
  To: Florian Westphal; +Cc: kbuild-all, linux-kernel

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next.git testing
head:   1baa240a3c6507449f4a3cd150dddacf69d95fb5
commit: 93d6b481397f4c62da1568b463a4d4b254578c37 [6/11] netfilter: make hook functions accept only one argument
config: i386-randconfig-a014-20211029 (https://download.01.org/0day-ci/archive/20220527/202205271540.880v8PNJ-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next.git/commit/?id=93d6b481397f4c62da1568b463a4d4b254578c37
        git remote add netfilter-nf-next git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next.git
        git fetch --no-tags netfilter-nf-next testing
        git checkout 93d6b481397f4c62da1568b463a4d4b254578c37
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash net/netfilter/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   net/netfilter/nf_nat_proto.c: In function 'nf_nat_ipv4_out':
>> net/netfilter/nf_nat_proto.c:721:25: warning: unused variable 'skb' [-Wunused-variable]
     721 |         struct sk_buff *skb = state->skb;
         |                         ^~~
   net/netfilter/nf_nat_proto.c: In function 'nf_nat_ipv6_out':
   net/netfilter/nf_nat_proto.c:960:25: warning: unused variable 'skb' [-Wunused-variable]
     960 |         struct sk_buff *skb = state->skb;
         |                         ^~~


vim +/skb +721 net/netfilter/nf_nat_proto.c

   717	
   718	static unsigned int
   719	nf_nat_ipv4_out(const struct nf_hook_state *state)
   720	{
 > 721		struct sk_buff *skb = state->skb;
   722	#ifdef CONFIG_XFRM
   723		const struct nf_conn *ct;
   724		enum ip_conntrack_info ctinfo;
   725		int err;
   726	#endif
   727		unsigned int ret;
   728	
   729		ret = nf_nat_ipv4_fn(state);
   730	#ifdef CONFIG_XFRM
   731		if (ret != NF_ACCEPT)
   732			return ret;
   733	
   734		if (IPCB(skb)->flags & IPSKB_XFRM_TRANSFORMED)
   735			return ret;
   736	
   737		ct = nf_ct_get(skb, &ctinfo);
   738		if (ct) {
   739			enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo);
   740	
   741			if (ct->tuplehash[dir].tuple.src.u3.ip !=
   742			     ct->tuplehash[!dir].tuple.dst.u3.ip ||
   743			    (ct->tuplehash[dir].tuple.dst.protonum != IPPROTO_ICMP &&
   744			     ct->tuplehash[dir].tuple.src.u.all !=
   745			     ct->tuplehash[!dir].tuple.dst.u.all)) {
   746				err = nf_xfrm_me_harder(state->net, skb, AF_INET);
   747				if (err < 0)
   748					ret = NF_DROP_ERR(err);
   749			}
   750		}
   751	#endif
   752		return ret;
   753	}
   754	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-27  7:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-27  7:03 [netfilter-nf-next:testing 6/11] net/netfilter/nf_nat_proto.c:721:25: warning: unused variable 'skb' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox