It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) went to the mosque of Banu Amr bin Awf, that is, the Masjid of Quba, and prayed in it. Some men of the Ansar came to him (peace and blessings be upon him) and began greeting him with salam while he (peace and blessings be upon him) was in prayer. (Ibn Umar, may Allah be pleased with them both, says:) I asked Sayyiduna Suhayb (may Allah be pleased with him): "When people greeted the Prophet (peace and blessings be upon him) with salam while he was praying, what did he (peace and blessings be upon him) do?" He said: "He (peace and blessings be upon him) would gesture with his hand."
Imam al-Nasa'i (may Allah have mercy on him) narrated it through Muhammad bin Mansur.
And Imam Ibn Majah (may Allah have mercy on him) narrated it through Ali bin Muhammad; both of them narrated it from Sufyan bin Uyaynah with a similar meaning.