xref: /illumos-gate/usr/src/tools/smatch/src/validation/sm_skb3.c (revision b30d193948be5a7794d7ae3ba0ed9c2f72c88e0f)
1 #include "check_debug.h"
2 
3 struct sk_buff {
4 	unsigned char *head, *data;
5 	unsigned short network_header;
6 };
7 
8 struct foo {
9 	int a, b, c;
10 };
11 
12 int frob(struct sk_buff *skb)
13 {
14 	struct foo *p;
15 
16 	p = skb->data + sizeof(int) * 2;
17 	__smatch_user_rl(p->a);
18 
19 	return 0;
20 }
21 
22 /*
23  * check-name: smatch: userdata from skb #3
24  * check-command: smatch -p=kernel -I.. sm_skb3.c
25  *
26  * check-output-start
27 sm_skb3.c:17 frob() user rl: 'p->a' = 's32min-s32max'
28  * check-output-end
29  */
30