* [pablo-gtp:main 11/11] drivers/net/gtp.c:281:30: sparse: sparse: incorrect type in assignment (different base types)
@ 2023-10-14 19:24 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-10-14 19:24 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/pablo/gtp.git main
head: 230b7c1e9db7fcb2b796845017ce64f35e7430f1
commit: 230b7c1e9db7fcb2b796845017ce64f35e7430f1 [11/11] gtp: support for IPv4-in-IPv6-GTP and IPv6-in-IPv4-GTP
config: i386-randconfig-062-20231014 (https://download.01.org/0day-ci/archive/20231015/202310150313.IPOOVXlp-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231015/202310150313.IPOOVXlp-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310150313.IPOOVXlp-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
drivers/net/gtp.c:260:17: sparse: sparse: restricted __be16 degrades to integer
drivers/net/gtp.c:260:17: sparse: sparse: restricted __be16 degrades to integer
>> drivers/net/gtp.c:281:30: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] @@ got int @@
drivers/net/gtp.c:281:30: sparse: expected restricted __be16 [usertype]
drivers/net/gtp.c:281:30: sparse: got int
drivers/net/gtp.c:284:30: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] @@ got int @@
drivers/net/gtp.c:284:30: sparse: expected restricted __be16 [usertype]
drivers/net/gtp.c:284:30: sparse: got int
>> drivers/net/gtp.c:309:47: sparse: sparse: cast from restricted __be16
drivers/net/gtp.c:1044:12: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] df @@ got unsigned short [usertype] frag_off @@
drivers/net/gtp.c:1044:12: sparse: expected restricted __be16 [usertype] df
drivers/net/gtp.c:1044:12: sparse: got unsigned short [usertype] frag_off
drivers/net/gtp.c:1062:24: sparse: sparse: restricted __be16 degrades to integer
drivers/net/gtp.c:1166:56: sparse: sparse: incorrect type in argument 6 (different base types) @@ expected unsigned short [usertype] frag_off @@ got restricted __be16 [usertype] frag_off @@
drivers/net/gtp.c:1166:56: sparse: expected unsigned short [usertype] frag_off
drivers/net/gtp.c:1166:56: sparse: got restricted __be16 [usertype] frag_off
drivers/net/gtp.c:1276:45: sparse: sparse: incorrect type in argument 9 (different base types) @@ expected restricted __be32 [usertype] label @@ got unsigned char [addressable] [usertype] tos @@
drivers/net/gtp.c:1276:45: sparse: expected restricted __be32 [usertype] label
drivers/net/gtp.c:1276:45: sparse: got unsigned char [addressable] [usertype] tos
vim +281 drivers/net/gtp.c
268
269 static int gtp_inner_proto(struct sk_buff *skb, unsigned int hdrlen,
270 __be16 *inner_proto)
271 {
272 __u8 *ip_version, _ip_version;
273
274 ip_version = skb_header_pointer(skb, hdrlen, sizeof(ip_version),
275 &_ip_version);
276 if (!ip_version)
277 return -1;
278
279 switch (*ip_version & 0xf0) {
280 case 0x40:
> 281 *inner_proto = ETH_P_IP;
282 break;
283 case 0x60:
284 *inner_proto = ETH_P_IPV6;
285 break;
286 default:
287 return -1;
288 }
289
290 return 0;
291 }
292
293 static int gtp_rx(struct pdp_ctx *pctx, struct sk_buff *skb,
294 unsigned int hdrlen, unsigned int role)
295 {
296 __be16 inner_proto;
297
298 if (gtp_inner_proto(skb, hdrlen, &inner_proto) < 0) {
299 netdev_dbg(pctx->dev, "GTP packet does not encapsulate an IP packet\n");
300 return -1;
301 }
302
303 if (!gtp_check_ms(skb, pctx, hdrlen, role, inner_proto)) {
304 netdev_dbg(pctx->dev, "No PDP ctx for this MS\n");
305 return 1;
306 }
307
308 /* Get rid of the GTP + UDP headers. */
> 309 if (iptunnel_pull_header(skb, hdrlen, htons(inner_proto),
310 !net_eq(sock_net(pctx->sk), dev_net(pctx->dev)))) {
311 pctx->dev->stats.rx_length_errors++;
312 goto err;
313 }
314
315 netdev_dbg(pctx->dev, "forwarding packet from GGSN to uplink\n");
316
317 /* Now that the UDP and the GTP header have been removed, set up the
318 * new network header. This is required by the upper layer to
319 * calculate the transport header.
320 */
321 skb_reset_network_header(skb);
322 skb_reset_mac_header(skb);
323
324 skb->dev = pctx->dev;
325
326 dev_sw_netstats_rx_add(pctx->dev, skb->len);
327
328 __netif_rx(skb);
329 return 0;
330
331 err:
332 pctx->dev->stats.rx_dropped++;
333 return -1;
334 }
335
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-10-14 19:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-14 19:24 [pablo-gtp:main 11/11] drivers/net/gtp.c:281:30: sparse: sparse: incorrect type in assignment (different base types) kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.