BAYHAQI 557:
from Zir b. Ḥubaysh —
[Machine] I went to Safwan bin Assal and I said to him: "You were one of the companions of the Messenger of Allah ﷺ , and it has been bothering me that I have traces of urine and feces on my socks. Please tell me anything you heard from the Messenger of Allah ﷺ regarding this." He replied: "He used to command us, when we were traveling or on a journey, not to remove our socks for three days and nights except in a state of major impurity, but it is permissible to remove them for urination, defecation, or sleep."
البيهقي ٥٥٧:
عن زر بن حبيسه —
أَتَيْتُ صَفْوَانَ بْنَ عَسَّالٍ فَقُلْتُ لَهُ إِنَّكَ كُنْتَ امْرَأً مِنْ أَصْحَابِ رَسُولِ اللهِ ﷺ وَإِنَّهُ قَدْ حَاكَ فِي صَدْرِي الْمَسْحُ عَلَى الْخُفَّيْنِ مِنَ الْبَوْلِ وَالْغَائِطِ فَأَخْبِرْنِي بِشَيْءٍ إِنْ كُنْتَ سَمِعْتَهُ مِنْ رَسُولِ اللهِ ﷺ؟ قَالَ كَانَ يَأْمُرُنَا إِذَا كُنَّا سَفَرًا أَوْ مُسَافِرِينَ أَنْ لَا نَخْلَعَ خِفَافَنَا ثَلَاثَةَ أَيَّامٍ وَلَيَالِيَهِنَّ إِلَّا مِنْ جَنَابَةٍ لَكِنْ مِنْ بَوْلٍ أَوْ غَائِطٍ أَوْ نَوْمٍ
hadithunlocked.com