MT#3997 MT#5193 Fix build_via_routes with only one external sbc.

(cherry picked from commit cc9fe6ed5ee36b04359fba7a4ba7ec1749eb375e)