How to get OffMeshLink from a NavMeshPath?

I’m using NavMesh.CalculatePath to get a NavMeshPath in a nav mesh with off-mesh links. The NavMeshPath only contains the corners of the path as Vector3 structs. If one of the path segments is an off-mesh link, how can I get the corresponding OffMeshLink object? Is there a better way than to search all off-mesh links in my scene manually?