MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ipcomp4_nonexp_encapcheck

Function ipcomp4_nonexp_encapcheck

freebsd/netipsec/xform_ipcomp.c:663–682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661
662#ifdef INET
663static int
664ipcomp4_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
684static const struct encaptab *ipe4_cookie = NULL;
685static const struct encap_config ipv4_encap_cfg = {

Callers

nothing calls this directly

Calls 2

bzeroFunction · 0.85
ipcomp_encapcheckFunction · 0.85

Tested by

no test coverage detected