| .. | .. |
|---|
| 593 | 593 | wg_allowedips_remove_by_peer(&t, a, &mutex); |
|---|
| 594 | 594 | test_negative(4, a, 192, 168, 0, 1); |
|---|
| 595 | 595 | |
|---|
| 596 | | - /* These will hit the WARN_ON(len >= MAX_ALLOWEDIPS_BITS) in free_node |
|---|
| 596 | + /* These will hit the WARN_ON(len >= MAX_ALLOWEDIPS_DEPTH) in free_node |
|---|
| 597 | 597 | * if something goes wrong. |
|---|
| 598 | 598 | */ |
|---|
| 599 | | - for (i = 0; i < MAX_ALLOWEDIPS_BITS; ++i) { |
|---|
| 600 | | - part = cpu_to_be64(~(1LLU << (i % 64))); |
|---|
| 601 | | - memset(&ip, 0xff, 16); |
|---|
| 602 | | - memcpy((u8 *)&ip + (i < 64) * 8, &part, 8); |
|---|
| 599 | + for (i = 0; i < 64; ++i) { |
|---|
| 600 | + part = cpu_to_be64(~0LLU << i); |
|---|
| 601 | + memset(&ip, 0xff, 8); |
|---|
| 602 | + memcpy((u8 *)&ip + 8, &part, 8); |
|---|
| 603 | + wg_allowedips_insert_v6(&t, &ip, 128, a, &mutex); |
|---|
| 604 | + memcpy(&ip, &part, 8); |
|---|
| 605 | + memset((u8 *)&ip + 8, 0, 8); |
|---|
| 603 | 606 | wg_allowedips_insert_v6(&t, &ip, 128, a, &mutex); |
|---|
| 604 | 607 | } |
|---|
| 605 | | - |
|---|
| 608 | + memset(&ip, 0, 16); |
|---|
| 609 | + wg_allowedips_insert_v6(&t, &ip, 128, a, &mutex); |
|---|
| 606 | 610 | wg_allowedips_free(&t, &mutex); |
|---|
| 607 | 611 | |
|---|
| 608 | 612 | wg_allowedips_init(&t); |
|---|