وَإِنْ طَافَ جُنُبًا: فَعَلَيْهِ بَدَنَةٌ، وَالْأَفْضَلُ أَنْ يُعِيدَ الطَّوَافَ مَا دَامَ بِمَكَّةَ، وَلَا ذَبْحَ عَلَيْهِ.
Translation: If the principal tawaf was performed in major ritual impurity, a badanah is due. Repeating the tawaf while still in Mecca is preferable, and then no offering remains due.
Badanah means the prescribed offering of a large sacrificial animal (camel or bovine). The text treats major impurity during the principal tawaf as a more serious deficiency.
It explicitly recommends repeating tawaf while still in Mecca and states that the offering is no longer due after valid repetition. This is specific to the stated defect; it is not a general rule that repeating any rite cancels every penalty.