mirror of
https://github.com/systemd/systemd.git
synced 2024-10-27 18:55:40 +03:00
libsystemd-network: do not request each daemon exist in sd_xxx_stop()
This commit is contained in:
parent
1008f5b069
commit
c8bae36372
@ -2135,9 +2135,10 @@ int sd_dhcp_client_send_decline(sd_dhcp_client *client) {
|
||||
}
|
||||
|
||||
int sd_dhcp_client_stop(sd_dhcp_client *client) {
|
||||
DHCP_CLIENT_DONT_DESTROY(client);
|
||||
if (!client)
|
||||
return 0;
|
||||
|
||||
assert_return(client, -EINVAL);
|
||||
DHCP_CLIENT_DONT_DESTROY(client);
|
||||
|
||||
client_stop(client, SD_DHCP_CLIENT_EVENT_STOP);
|
||||
client->state = DHCP_STATE_STOPPED;
|
||||
|
@ -225,7 +225,8 @@ sd_event *sd_dhcp_server_get_event(sd_dhcp_server *server) {
|
||||
}
|
||||
|
||||
int sd_dhcp_server_stop(sd_dhcp_server *server) {
|
||||
assert_return(server, -EINVAL);
|
||||
if (!server)
|
||||
return 0;
|
||||
|
||||
server->receive_message =
|
||||
sd_event_source_unref(server->receive_message);
|
||||
|
@ -1676,7 +1676,8 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state) {
|
||||
}
|
||||
|
||||
int sd_dhcp6_client_stop(sd_dhcp6_client *client) {
|
||||
assert_return(client, -EINVAL);
|
||||
if (!client)
|
||||
return 0;
|
||||
|
||||
client_stop(client, SD_DHCP6_CLIENT_EVENT_STOP);
|
||||
|
||||
|
@ -144,7 +144,8 @@ static void ipv4acd_client_notify(sd_ipv4acd *acd, int event) {
|
||||
int sd_ipv4acd_stop(sd_ipv4acd *acd) {
|
||||
IPv4ACDState old_state;
|
||||
|
||||
assert_return(acd, -EINVAL);
|
||||
if (!acd)
|
||||
return 0;
|
||||
|
||||
old_state = acd->state;
|
||||
|
||||
|
@ -89,7 +89,8 @@ int sd_ipv4ll_new(sd_ipv4ll **ret) {
|
||||
}
|
||||
|
||||
int sd_ipv4ll_stop(sd_ipv4ll *ll) {
|
||||
assert_return(ll, -EINVAL);
|
||||
if (!ll)
|
||||
return 0;
|
||||
|
||||
return sd_ipv4acd_stop(ll->acd);
|
||||
}
|
||||
|
@ -276,7 +276,8 @@ fail:
|
||||
}
|
||||
|
||||
_public_ int sd_lldp_stop(sd_lldp *lldp) {
|
||||
assert_return(lldp, -EINVAL);
|
||||
if (!lldp)
|
||||
return 0;
|
||||
|
||||
if (lldp->fd < 0)
|
||||
return 0;
|
||||
|
@ -321,7 +321,8 @@ static int ndisc_timeout_no_ra(sd_event_source *s, uint64_t usec, void *userdata
|
||||
}
|
||||
|
||||
_public_ int sd_ndisc_stop(sd_ndisc *nd) {
|
||||
assert_return(nd, -EINVAL);
|
||||
if (!nd)
|
||||
return 0;
|
||||
|
||||
if (nd->fd < 0)
|
||||
return 0;
|
||||
|
@ -353,7 +353,8 @@ fail:
|
||||
_public_ int sd_radv_stop(sd_radv *ra) {
|
||||
int r;
|
||||
|
||||
assert_return(ra, -EINVAL);
|
||||
if (!ra)
|
||||
return 0;
|
||||
|
||||
if (ra->state == SD_RADV_STATE_IDLE)
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user