inet6_rth_add() — Add an IPv6 address to end of the routing header

Standards

Standards / Extensions C or C++ Dependencies

RFC3542

both z/OS® V1R7

Format

#define _OPEN_SYS_SOCK_IPV6
#include <netinet/in.h>

int inet6_rth_add(void *bp, const struct in6_addr *addr); 

General description

inet6_rth_add() adds the IPv6 address pointed to by addr to the end of the routing header that is being constructed.

Returned value

If successful, inet6_rth_add() returns 0 and the segleft member of the routing header is updated to account for the new address.

Upon failure, returns -1 and errno is set to one of the following:

EINVAL If one of the following is true:

  • bp is NULL;
  • the routing header indicates an unsupported header type;
  • the routing header contains a non-valid number of segments for the type;
  • there is not enough room to add the address.

Related information