sd-rtnl: link - allow setting the change mask
This commit is contained in:
parent
41add995cf
commit
5d4795f372
|
@ -95,7 +95,7 @@ static int start_interface(sd_rtnl *rtnl, int if_loopback, struct in_addr *ipv4_
|
|||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_rtnl_message_link_set_flags(req, IFF_UP);
|
||||
r = sd_rtnl_message_link_set_flags(req, IFF_UP, IFF_UP);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
|
|
@ -167,12 +167,15 @@ int sd_rtnl_message_route_new(uint16_t nlmsg_type, unsigned char rtm_family,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int sd_rtnl_message_link_set_flags(sd_rtnl_message *m, unsigned flags) {
|
||||
int sd_rtnl_message_link_set_flags(sd_rtnl_message *m, unsigned flags, unsigned change) {
|
||||
struct ifinfomsg *ifi;
|
||||
|
||||
ifi = NLMSG_DATA(m->hdr);
|
||||
|
||||
ifi->ifi_flags = flags;
|
||||
if (change)
|
||||
ifi->ifi_change = change;
|
||||
else
|
||||
ifi->ifi_change = 0xffffffff;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -713,7 +713,7 @@ static int link_up(Link *link) {
|
|||
return r;
|
||||
}
|
||||
|
||||
r = sd_rtnl_message_link_set_flags(req, IFF_UP);
|
||||
r = sd_rtnl_message_link_set_flags(req, IFF_UP, IFF_UP);
|
||||
if (r < 0) {
|
||||
log_error_link(link, "Could not set link flags: %s", strerror(-r));
|
||||
return r;
|
||||
|
|
|
@ -84,7 +84,7 @@ sd_rtnl_message *sd_rtnl_message_unref(sd_rtnl_message *m);
|
|||
int sd_rtnl_message_get_errno(sd_rtnl_message *m);
|
||||
int sd_rtnl_message_get_type(sd_rtnl_message *m, uint16_t *type);
|
||||
|
||||
int sd_rtnl_message_link_set_flags(sd_rtnl_message *m, unsigned flags);
|
||||
int sd_rtnl_message_link_set_flags(sd_rtnl_message *m, unsigned flags, unsigned change);
|
||||
int sd_rtnl_message_link_set_type(sd_rtnl_message *m, unsigned type);
|
||||
int sd_rtnl_message_link_get_ifindex(sd_rtnl_message *m, int *ifindex);
|
||||
int sd_rtnl_message_link_get_flags(sd_rtnl_message *m, unsigned *flags);
|
||||
|
|
Loading…
Reference in a new issue