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

Function key_checksockaddrs

freebsd/netipsec/key.c:825–852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

823}
824
825static int
826key_checksockaddrs(struct sockaddr *src, struct sockaddr *dst)
827{
828
829 /* family match */
830 if (src->sa_family != dst->sa_family)
831 return (EINVAL);
832 /* sa_len match */
833 if (src->sa_len != dst->sa_len)
834 return (EINVAL);
835 switch (src->sa_family) {
836#ifdef INET
837 case AF_INET:
838 if (src->sa_len != sizeof(struct sockaddr_in))
839 return (EINVAL);
840 break;
841#endif
842#ifdef INET6
843 case AF_INET6:
844 if (src->sa_len != sizeof(struct sockaddr_in6))
845 return (EINVAL);
846 break;
847#endif
848 default:
849 return (EAFNOSUPPORT);
850 }
851 return (0);
852}
853
854struct secpolicy *
855key_do_allocsp(struct secpolicyindex *spidx, u_int dir)

Callers 9

key_spdaddFunction · 0.85
key_spddeleteFunction · 0.85
key_getspiFunction · 0.85
key_updateaddressesFunction · 0.85
key_updateFunction · 0.85
key_addFunction · 0.85
key_deleteFunction · 0.85
key_getFunction · 0.85
key_acquire2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected