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

int rtnl_link_change ( struct nl_sock *  sk,
struct rtnl_link *  old,
struct rtnl_link *  tmpl,
int  flags 
)

Change link attributes

  • sk Netlink socket.
  • old link to be changed
  • tmpl template with requested changes
  • flags additional netlink message flags
Builds a new netlink message by calling rtnl_link_build_change_request(), sends the request to the kernel and waits for the next ACK to be received, i.e. blocks until the request has been processed.

Returns:
0 on success or a negative error code
Note:
Not all attributes can be changed, see Changeable Attributes for more details.

Definition at line 945 of file link.c.

References nl_send_auto_complete(), nlmsg_free(), and rtnl_link_build_change_request().

{
      struct nl_msg *msg;
      int err;
      
      if ((err = rtnl_link_build_change_request(old, tmpl, flags, &msg)) < 0)
            return err;
      
      err = nl_send_auto_complete(sk, msg);
      nlmsg_free(msg);
      if (err < 0)
            return err;

      return wait_for_ack(sk);
}


Generated by  Doxygen 1.6.0   Back to index