--- if_vxlan.c 2019-11-19 13:57:56.046105000 +0200 +++ if_vxlan.c 2019-11-19 14:02:21.057692000 +0200 @@ -2725,8 +2725,9 @@ vxlan_clone_create(struct if_clone *ifc, int unit, caddr_t params) { struct vxlan_softc *sc; - struct ifnet *ifp; + struct ifnet *ifp, *ifpp; struct ifvxlanparam vxlp; + const short r4hdrs = 100; /* Reasonable standard offset for MTU from vxlandev iface */ int error; sc = malloc(sizeof(struct vxlan_softc), M_VXLAN, M_WAITOK | M_ZERO); @@ -2776,6 +2777,22 @@ ifp->if_baudrate = 0; ifp->if_hdrlen = 0; + + if (vxlp.vxlp_with & VXLAN_PARAM_WITH_MULTICAST_IF) { + ifpp = ifunit_ref(sc->vxl_mc_ifname); + if (ifpp == NULL) { + if_printf(sc->vxl_ifp, "multicast interface %s does " + "not exist\n", sc->vxl_mc_ifname); + goto fail; + } + if (ifpp->if_mtu <= r4hdrs) { + if_printf(sc->vxl_ifp, "multicast interface %s does " + "not have sufficient MTU\n", sc->vxl_mc_ifname); + goto fail; + } + + ifp->if_mtu = ifpp->if_mtu - r4hdrs; + } return (0);