Logo Search packages:      
Sourcecode: libnl version File versions  Download package

int rtnl_addr_set_peer ( struct rtnl_addr *  addr,
struct nl_addr *  peer 

Set peer address of address object.

  • addr Address object to be modified.
  • peer New peer address.
Assigns the new peer address to the specified address object. The address is validated against the address family if set already via either rtnl_addr_set_family() or by setting one of the other addresses. The assignment fails if the address families mismatch. In case the address family has not been specified yet, the address family of this new address is elected to be the requirement.

0 on success or a negative error code.

Definition at line 999 of file addr.c.

References nl_addr_get_prefixlen().

      return __assign_addr(addr, &addr->a_peer, peer, ADDR_ATTR_PEER);

      addr->a_prefixlen = nl_addr_get_prefixlen(addr->a_peer);
      addr->a_mask |= ADDR_ATTR_PREFIXLEN;

      return 0;

Generated by  Doxygen 1.6.0   Back to index