MT#8797 backport upstream patches to deal with double record route