* packet checks for transport mode: * - no reported IPsec related failures in ol_flags * - tail and header lengths are valid * - padding bytes are valid * apart from checks, function also updates tail offset (and segment) * by taking into account pad length. */
| 455 | * by taking into account pad length. |
| 456 | */ |
| 457 | static inline int32_t |
| 458 | trs_process_check(struct rte_mbuf *mb, struct rte_mbuf **ml, |
| 459 | uint32_t *tofs, struct rte_esp_tail espt, uint32_t hlen, uint32_t tlen) |
| 460 | { |
| 461 | if ((mb->ol_flags & RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED) != 0 || |
| 462 | tlen + hlen > mb->pkt_len) |
| 463 | return -EBADMSG; |
| 464 | |
| 465 | /* padding bytes are spread over multiple segments */ |
| 466 | if (tofs[0] < espt.pad_len) { |
| 467 | tofs[0] = mb->pkt_len - tlen; |
| 468 | ml[0] = mbuf_get_seg_ofs(mb, tofs); |
| 469 | } else |
| 470 | tofs[0] -= espt.pad_len; |
| 471 | |
| 472 | return check_pad_bytes(ml[0], tofs[0], espt.pad_len); |
| 473 | } |
| 474 | |
| 475 | /* |
| 476 | * packet checks for tunnel mode: |
no test coverage detected