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

Function vxlan_pick_source_port

freebsd/net/if_vxlan.c:2380–2395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2378
2379#if defined(INET) || defined(INET6)
2380static uint16_t
2381vxlan_pick_source_port(struct vxlan_softc *sc, struct mbuf *m)
2382{
2383 int range;
2384 uint32_t hash;
2385
2386 range = sc->vxl_max_port - sc->vxl_min_port + 1;
2387
2388 if (M_HASHTYPE_ISHASH(m))
2389 hash = m->m_pkthdr.flowid;
2390 else
2391 hash = jenkins_hash(m->m_data, ETHER_HDR_LEN,
2392 sc->vxl_port_hash_key);
2393
2394 return (sc->vxl_min_port + (hash % range));
2395}
2396
2397static void
2398vxlan_encap_header(struct vxlan_softc *sc, struct mbuf *m, int ipoff,

Callers 2

vxlan_encap4Function · 0.85
vxlan_encap6Function · 0.85

Calls 1

jenkins_hashFunction · 0.85

Tested by

no test coverage detected