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

int rtnl_link_change ( struct nl_handle *  handle,
struct rtnl_link *  old,
struct rtnl_link *  tmpl,
int  flags 

Change link attributes

  • handle netlink handle
  • 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.

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

Definition at line 806 of file link.c.

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

      int err;
      struct nl_msg *msg;
      msg = rtnl_link_build_change_request(old, tmpl, flags);
      if (!msg)
            return nl_errno(ENOMEM);
      err = nl_send_auto_complete(handle, msg);
      if (err < 0)
            return err;

      return nl_wait_for_ack(handle);

Generated by  Doxygen 1.6.0   Back to index