* check that for each rule it's SPI has a correspondent entry in SAD */
| 650 | * check that for each rule it's SPI has a correspondent entry in SAD |
| 651 | */ |
| 652 | static int |
| 653 | check_spi_value(struct sa_ctx *sa_ctx, int inbound) |
| 654 | { |
| 655 | uint32_t i, num, spi; |
| 656 | int32_t spi_idx; |
| 657 | struct acl6_rules *acr; |
| 658 | |
| 659 | if (inbound != 0) { |
| 660 | acr = acl6_rules_in; |
| 661 | num = nb_acl6_rules_in; |
| 662 | } else { |
| 663 | acr = acl6_rules_out; |
| 664 | num = nb_acl6_rules_out; |
| 665 | } |
| 666 | |
| 667 | for (i = 0; i != num; i++) { |
| 668 | spi = acr[i].data.userdata; |
| 669 | if (spi != DISCARD && spi != BYPASS) { |
| 670 | spi_idx = sa_spi_present(sa_ctx, spi, inbound); |
| 671 | if (spi_idx < 0) { |
| 672 | RTE_LOG(ERR, IPSEC, |
| 673 | "SPI %u is not present in SAD\n", |
| 674 | spi); |
| 675 | return -ENOENT; |
| 676 | } |
| 677 | /* Update userdata with spi index */ |
| 678 | acr[i].data.userdata = spi_idx + 1; |
| 679 | } |
| 680 | } |
| 681 | |
| 682 | return 0; |
| 683 | } |
| 684 | |
| 685 | void |
| 686 | sp6_init(struct socket_ctx *ctx, int32_t socket_id) |
no test coverage detected