Have common code for IPv6 and IPv4 routes.

Change-Id: Id2a97faf4c29af2435d59ba0b4e4d1df44f63ef1
Merge "Have common code for IPv6 and IPv4 routes."