netfilter: nft_compat: don't truncate ethernet protocol type to u8
authorArturo Borrero <arturo.borrero.glez@gmail.com>
Sat, 21 Feb 2015 18:30:55 +0000 (19:30 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 22 Feb 2015 20:04:06 +0000 (21:04 +0100)
commit2156d321b879cdadb95a633d046169cfebdbf784
tree62601a4a37c59c71f69183e7784d4d1528267202
parent3f34b24a732bab9635c4b32823268c37c01b40f0
netfilter: nft_compat: don't truncate ethernet protocol type to u8

Use u16 for protocol and then cast it to __be16

>> net/netfilter/nft_compat.c:140:37: sparse: incorrect type in assignment (different base types)
   net/netfilter/nft_compat.c:140:37:    expected restricted __be16 [usertype] ethproto
   net/netfilter/nft_compat.c:140:37:    got unsigned char [unsigned] [usertype] proto
>> net/netfilter/nft_compat.c:351:37: sparse: incorrect type in assignment (different base types)
   net/netfilter/nft_compat.c:351:37:    expected restricted __be16 [usertype] ethproto
   net/netfilter/nft_compat.c:351:37:    got unsigned char [unsigned] [usertype] proto

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_compat.c