| 2378 | |
| 2379 | #if defined(INET) || defined(INET6) |
| 2380 | static uint16_t |
| 2381 | vxlan_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 | |
| 2397 | static void |
| 2398 | vxlan_encap_header(struct vxlan_softc *sc, struct mbuf *m, int ipoff, |
no test coverage detected