“The Prophet (ﷺ) did not forbid (eating) mastigures, but he found that distasteful. It is the food of most shepherds, and Allah, the Mighty and Sublime, has benefited more than one person thereby. If I had some I would eat it.”

Another chain reports a similar hadith.
Sunan Ibn Majah Book 28, Hadith 40