I totally agree with Tom's solution, but the question is:
why do you want to know the NetDevice pointer ?I usually don't like the answer (hint: don't tell me), because usually it's something like "I need to know some parameter of the receiver".
From the Routing Protocol point of view, remember that any routing decision should be based on local measures or stuff that is passed through the routing protocol messages. Any "direct" way to poke the other end NetDevice is cheating.
Once this is known and accepted, one can go ahead and do whatever is needed/wanted.
A notable example are position-based routing protocol, where one assumes that the two endpoints knows their respective position. In my opinion this is still black magic, but sometimes one can do a simplifying assumption before going full complex.
Anyway, this is just to suggest to double check if you really need the other NetDevice pointer.
Have fun,
T.
PS: the method above is damn slow. It's best to have a global "almighty" helper caching the lookups. It's still totally imaginary, but at least it will not slow down too much your simulations.