Killing dogs except dogs used for hunting or farming Sunan Ibn Majah 3200

Arabic hadith text
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا شَبَابَةُ، حَدَّثَنَا شُعْبَةُ، عَنْ أَبِي التَّيَّاحِ، قَالَ سَمِعْتُ مُطَرِّفًا، يُحَدِّثُ عَنْ عَبْدِ اللَّهِ بْنِ مُغَفَّلٍ، أَنَّ رَسُولَ اللَّهِ ـ صلى الله عليه وسلم ـأَمَرَ بِقَتْلِ الْكِلاَبِ ثُمَّ قَالَ ‏"‏ مَا لَهُمْ وَلِلْكِلاَبِ ‏"‏ ‏.‏ ثُمَّ رَخَّصَ لَهُمْ فِي كَلْبِ الصَّيْدِ
Translation
It wasnarrated from ‘Abdullah bin Mughaffal that the Messenger ofAllah(ﷺ) commanded that dogs be killed, then he said

“What do theyuse dogs for?” Then he permitted them to keep hunting dogs.