Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link: Add function to unset carrier request #2

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/netlink/route/link.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ extern int rtnl_link_get_master(struct rtnl_link *);

extern void rtnl_link_set_carrier(struct rtnl_link *, uint8_t);
extern uint8_t rtnl_link_get_carrier(struct rtnl_link *);
extern void rtnl_link_unset_carrier_request_flag(struct rtnl_link *);

extern int rtnl_link_get_carrier_changes(struct rtnl_link *, uint32_t *);

Expand Down
11 changes: 11 additions & 0 deletions lib/route/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -2433,6 +2433,17 @@ uint8_t rtnl_link_get_carrier(struct rtnl_link *link)
return link->l_carrier;
}

/**
* Unset carrier request of link object
* @arg link Link object
*
* @see rtnl_link_set_carrier()
*/
void rtnl_link_unset_carrier_request_flag(struct rtnl_link *link)
{
link->ce_mask &= ~LINK_ATTR_CARRIER;
}

/**
* Return carrier on/off changes of link object
* @arg link Link object
Expand Down
1 change: 1 addition & 0 deletions libnl-route-3.sym
Original file line number Diff line number Diff line change
Expand Up @@ -1358,4 +1358,5 @@ global:
rtnl_interlink_set_net_id;
rtnl_flower_set_ip_ttl;
rtnl_flower_get_ip_ttl;
rtnl_link_unset_carrier_request_flag;
} libnl_3_6;
Loading