* IPSEC_CAP() method implementation for IPv4. */
| 647 | * IPSEC_CAP() method implementation for IPv4. |
| 648 | */ |
| 649 | int |
| 650 | ipsec4_capability(struct mbuf *m, u_int cap) |
| 651 | { |
| 652 | |
| 653 | switch (cap) { |
| 654 | case IPSEC_CAP_BYPASS_FILTER: |
| 655 | /* |
| 656 | * Bypass packet filtering for packets previously handled |
| 657 | * by IPsec. |
| 658 | */ |
| 659 | if (!V_ip4_filtertunnel && |
| 660 | m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL) |
| 661 | return (1); |
| 662 | return (0); |
| 663 | case IPSEC_CAP_OPERABLE: |
| 664 | /* Do we have active security policies? */ |
| 665 | if (key_havesp(IPSEC_DIR_INBOUND) != 0 || |
| 666 | key_havesp(IPSEC_DIR_OUTBOUND) != 0) |
| 667 | return (1); |
| 668 | return (0); |
| 669 | }; |
| 670 | return (EOPNOTSUPP); |
| 671 | } |
| 672 | |
| 673 | #endif /* INET */ |
| 674 |
nothing calls this directly
no test coverage detected