---
name: "rdma_get_peer_addr"
section: "3"
platform: "linux"
package: "rdma-core"
version: "65.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/rdma_get_peer_addr"
---

# rdma\_get\_peer\_addr(3)

Returns the remote IP address of a bound rdma\_cm\_id.

## NAME

rdma\_get\_peer\_addr - Returns the remote IP address of a bound rdma\_cm\_id.

## SYNOPSIS

**#include \<rdma/rdma\_cma.h\>**

**struct sockaddr \* rdma\_get\_peer\_addr** **(struct rdma\_cm\_id \****id***);**

## ARGUMENTS

- id

  RDMA identifier.

## DESCRIPTION

Returns the remote IP address associated with an rdma\_cm\_id.

## RETURN VALUE

Returns a pointer to the sockaddr address of the connected peer.  If the rdma\_cm\_id is not connected, the contents of the sockaddr structure will be set to all zeroes.

## SEE ALSO

[rdma\_resolve\_addr(3)](/rdma_resolve_addr/3.md), [rdma\_get\_src\_port(3)](/rdma_get_src_port/3.md), [rdma\_get\_dst\_port(3)](/rdma_get_dst_port/3.md), [rdma\_get\_local\_addr(3)](/rdma_get_local_addr/3.md)
