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

Function setsockaddrs

freebsd/netipsec/xform_tcp.c:221–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221static void
222setsockaddrs(const struct mbuf *m, union sockaddr_union *src,
223 union sockaddr_union *dst)
224{
225 struct ip *ip;
226
227 IPSEC_ASSERT(m->m_len >= sizeof(*ip), ("unexpected mbuf len"));
228
229 ip = mtod(m, struct ip *);
230 switch (ip->ip_v) {
231#ifdef INET
232 case IPVERSION:
233 ipsec4_setsockaddrs(m, src, dst);
234 break;
235#endif
236#ifdef INET6
237 case (IPV6_VERSION >> 4):
238 ipsec6_setsockaddrs(m, src, dst);
239 break;
240#endif
241 default:
242 bzero(src, sizeof(*src));
243 bzero(dst, sizeof(*dst));
244 }
245}
246
247/*
248 * Compute TCP-MD5 hash of an *INBOUND* TCP segment.

Callers 2

tcp_ipsec_inputFunction · 0.85
tcp_ipsec_outputFunction · 0.85

Calls 3

ipsec4_setsockaddrsFunction · 0.85
ipsec6_setsockaddrsFunction · 0.85
bzeroFunction · 0.85

Tested by

no test coverage detected