route_table: Split allocation code to its own functionChange-Id: Id081d6de14be84b05ed38f3f8211ba91e675cff0