Ibn Sirin (may Allah have mercy on him) narrates that Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) greeted the Messenger of Allah (peace and blessings be upon him) with salam while he was praying, and he (peace and blessings be upon him) returned the greeting by gesturing with his head.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3407
Muhammad (Ibn Sirin) narrates: I was informed that Ibn Mas'ud (may Allah be pleased with him) said: When I came to the Messenger of Allah (peace and blessings be upon him) on my return from Abyssinia, I went to greet him and found him praying. I greeted him with salam, and he (peace and blessings be upon him) gestured with his head.
This is the preserved (mahfuz) version, and it is mursal.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3408
Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) narrates: When I returned from Abyssinia, I came to the Messenger of Allah (peace and blessings be upon him) while he was praying. I greeted him with salam, and he (peace and blessings be upon him) replied by gesturing with his head.
Only Abu Ya'la Muhammad bin al-Salt al-Tuzi narrated it (in this way).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3409