Abu Hurairah reported the Messenger of Allah (May peace be upon him) as saying:
one who is riding should salute one who is walking. He then mentioned the rest of the tradition.