Re: [PATCH v2] AF_PACKET doesnt strip VLAN information

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

 



Hi Sriram,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on hnaz-linux-mm/master]
[also build test WARNING on sparc-next/master linus/master v5.8-rc5 next-20200717]
[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]

url:    https://github.com/0day-ci/linux/commits/Sriram-Krishnan/AF_PACKET-doesnt-strip-VLAN-information/20200718-172707
base:   https://github.com/hnaz/linux-mm master
config: s390-randconfig-s031-20200719 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.2-49-g707c5017-dirty
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=s390 

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


sparse warnings: (new ones prefixed by >>)

>> net/packet/af_packet.c:1877:52: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected unsigned short [usertype] *vlan_tci @@     got restricted __be16 * @@
>> net/packet/af_packet.c:1877:52: sparse:     expected unsigned short [usertype] *vlan_tci
>> net/packet/af_packet.c:1877:52: sparse:     got restricted __be16 *
>> net/packet/af_packet.c:1881:64: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected unsigned short [usertype] vlan_tci @@     got restricted __be16 [addressable] [usertype] vlan_tci @@
   net/packet/af_packet.c:1881:64: sparse:     expected unsigned short [usertype] vlan_tci
>> net/packet/af_packet.c:1881:64: sparse:     got restricted __be16 [addressable] [usertype] vlan_tci

vim +1877 net/packet/af_packet.c

  1859	
  1860	static int packet_parse_headers(struct sk_buff *skb, struct socket *sock)
  1861	{
  1862		if ((!skb->protocol || skb->protocol == htons(ETH_P_ALL)) &&
  1863		    sock->type == SOCK_RAW) {
  1864			__be16 ethertype;
  1865	
  1866			skb_reset_mac_header(skb);
  1867	
  1868			ethertype = eth_hdr(skb)->h_proto;
  1869			/*
  1870			 * If Vlan tag is present in the packet
  1871			 *  move it to skb
  1872			*/
  1873			if (eth_type_vlan(ethertype)) {
  1874				int err;
  1875				__be16 vlan_tci;
  1876	
> 1877				err = __skb_vlan_pop(skb, &vlan_tci);
  1878				if (unlikely(err))
  1879					return err;
  1880	
> 1881				__vlan_hwaccel_put_tag(skb, ethertype, vlan_tci);
  1882			}
  1883	
  1884			skb->protocol = dev_parse_header_protocol(skb);
  1885		}
  1886	
  1887		skb_probe_transport_header(skb);
  1888		return 0;
  1889	}
  1890	

---
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]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux