| 1 |
/* { dg-do compile } */ |
| 2 |
|
| 3 |
extern char tag_data[]; |
| 4 |
struct pppoe_tag { |
| 5 |
unsigned short tag_type; |
| 6 |
unsigned short tag_len; |
| 7 |
}; |
| 8 |
|
| 9 |
char code; |
| 10 |
int *add_tag_pack; |
| 11 |
void *add_tag_data; |
| 12 |
short e; |
| 13 |
long c, d; |
| 14 |
|
| 15 |
static int add_tag(int type, int len) { |
| 16 |
short a, b; |
| 17 |
struct pppoe_tag *tag = (struct pppoe_tag *)add_tag_pack; |
| 18 |
if (e + len || len < 0) |
| 19 |
return 1; |
| 20 |
b = __builtin_bswap16(type); |
| 21 |
tag->tag_type = b; |
| 22 |
a = __builtin_bswap16(len); |
| 23 |
tag->tag_len = a; |
| 24 |
if (add_tag_data) |
| 25 |
__builtin___memcpy_chk(tag_data, add_tag_data, len, c); |
| 26 |
return 0; |
| 27 |
} |
| 28 |
void pppoe_serv_read() { |
| 29 |
switch (code) |
| 30 |
case 9: { |
| 31 |
add_tag(2, d); |
| 32 |
add_tag(0, 2); |
| 33 |
} |
| 34 |
} |