| 661 | |
| 662 | #ifdef INET |
| 663 | static int |
| 664 | ipcomp4_nonexp_encapcheck(const struct mbuf *m, int off, int proto, |
| 665 | void *arg __unused) |
| 666 | { |
| 667 | union sockaddr_union src, dst; |
| 668 | const struct ip *ip; |
| 669 | |
| 670 | if (V_ipcomp_enable == 0) |
| 671 | return (0); |
| 672 | if (proto != IPPROTO_IPV4 && proto != IPPROTO_IPV6) |
| 673 | return (0); |
| 674 | bzero(&src, sizeof(src)); |
| 675 | bzero(&dst, sizeof(dst)); |
| 676 | src.sa.sa_family = dst.sa.sa_family = AF_INET; |
| 677 | src.sin.sin_len = dst.sin.sin_len = sizeof(struct sockaddr_in); |
| 678 | ip = mtod(m, const struct ip *); |
| 679 | src.sin.sin_addr = ip->ip_src; |
| 680 | dst.sin.sin_addr = ip->ip_dst; |
| 681 | return (ipcomp_encapcheck(&src, &dst)); |
| 682 | } |
| 683 | |
| 684 | static const struct encaptab *ipe4_cookie = NULL; |
| 685 | static const struct encap_config ipv4_encap_cfg = { |
nothing calls this directly
no test coverage detected