| 2395 | } |
| 2396 | |
| 2397 | static void |
| 2398 | vxlan_encap_header(struct vxlan_softc *sc, struct mbuf *m, int ipoff, |
| 2399 | uint16_t srcport, uint16_t dstport) |
| 2400 | { |
| 2401 | struct vxlanudphdr *hdr; |
| 2402 | struct udphdr *udph; |
| 2403 | struct vxlan_header *vxh; |
| 2404 | int len; |
| 2405 | |
| 2406 | len = m->m_pkthdr.len - ipoff; |
| 2407 | MPASS(len >= sizeof(struct vxlanudphdr)); |
| 2408 | hdr = mtodo(m, ipoff); |
| 2409 | |
| 2410 | udph = &hdr->vxlh_udp; |
| 2411 | udph->uh_sport = srcport; |
| 2412 | udph->uh_dport = dstport; |
| 2413 | udph->uh_ulen = htons(len); |
| 2414 | udph->uh_sum = 0; |
| 2415 | |
| 2416 | vxh = &hdr->vxlh_hdr; |
| 2417 | vxh->vxlh_flags = htonl(VXLAN_HDR_FLAGS_VALID_VNI); |
| 2418 | vxh->vxlh_vni = htonl(sc->vxl_vni << VXLAN_HDR_VNI_SHIFT); |
| 2419 | } |
| 2420 | #endif |
| 2421 | |
| 2422 | /* |
no outgoing calls
no test coverage detected