mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 18:23:32 +08:00
Merge pull request #9290 from poettering/radv-fixlets
tiny sd-radv fixlets
This commit is contained in:
commit
f0d97606e9
@ -77,6 +77,7 @@ _public_ sd_event *sd_radv_get_event(sd_radv *ra) {
|
||||
}
|
||||
|
||||
static void radv_reset(sd_radv *ra) {
|
||||
assert(ra);
|
||||
|
||||
ra->timeout_event_source =
|
||||
sd_event_source_unref(ra->timeout_event_source);
|
||||
@ -120,6 +121,9 @@ _public_ sd_radv *sd_radv_unref(sd_radv *ra) {
|
||||
radv_reset(ra);
|
||||
|
||||
sd_radv_detach_event(ra);
|
||||
|
||||
ra->fd = safe_close(ra->fd);
|
||||
|
||||
return mfree(ra);
|
||||
}
|
||||
|
||||
@ -607,8 +611,8 @@ _public_ int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p, bool dynamic) {
|
||||
}
|
||||
|
||||
_public_ sd_radv_prefix *sd_radv_remove_prefix(sd_radv *ra,
|
||||
struct in6_addr *prefix,
|
||||
uint8_t prefixlen) {
|
||||
const struct in6_addr *prefix,
|
||||
unsigned char prefixlen) {
|
||||
sd_radv_prefix *cur, *next;
|
||||
|
||||
assert_return(ra, NULL);
|
||||
@ -675,9 +679,8 @@ _public_ int sd_radv_set_dnssl(sd_radv *ra, uint32_t lifetime,
|
||||
|
||||
assert_return(ra, -EINVAL);
|
||||
|
||||
if (!search_list || *search_list == NULL) {
|
||||
if (strv_isempty(search_list)) {
|
||||
ra->dnssl = mfree(ra->dnssl);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -768,7 +771,7 @@ _public_ sd_radv_prefix *sd_radv_prefix_unref(sd_radv_prefix *p) {
|
||||
return mfree(p);
|
||||
}
|
||||
|
||||
_public_ int sd_radv_prefix_set_prefix(sd_radv_prefix *p, struct in6_addr *in6_addr,
|
||||
_public_ int sd_radv_prefix_set_prefix(sd_radv_prefix *p, const struct in6_addr *in6_addr,
|
||||
unsigned char prefixlen) {
|
||||
assert_return(p, -EINVAL);
|
||||
assert_return(in6_addr, -EINVAL);
|
||||
|
@ -64,8 +64,8 @@ int sd_radv_set_managed_information(sd_radv *ra, int managed);
|
||||
int sd_radv_set_other_information(sd_radv *ra, int other);
|
||||
int sd_radv_set_preference(sd_radv *ra, unsigned preference);
|
||||
int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p, bool dynamic);
|
||||
sd_radv_prefix *sd_radv_remove_prefix(sd_radv *ra, struct in6_addr *prefix,
|
||||
uint8_t prefixlen);
|
||||
sd_radv_prefix *sd_radv_remove_prefix(sd_radv *ra, const struct in6_addr *prefix,
|
||||
unsigned char prefixlen);
|
||||
int sd_radv_set_rdnss(sd_radv *ra, uint32_t lifetime,
|
||||
const struct in6_addr *dns, size_t n_dns);
|
||||
int sd_radv_set_dnssl(sd_radv *ra, uint32_t lifetime, char **search_list);
|
||||
@ -75,7 +75,7 @@ int sd_radv_prefix_new(sd_radv_prefix **ret);
|
||||
sd_radv_prefix *sd_radv_prefix_ref(sd_radv_prefix *ra);
|
||||
sd_radv_prefix *sd_radv_prefix_unref(sd_radv_prefix *ra);
|
||||
|
||||
int sd_radv_prefix_set_prefix(sd_radv_prefix *p, struct in6_addr *in6_addr,
|
||||
int sd_radv_prefix_set_prefix(sd_radv_prefix *p, const struct in6_addr *in6_addr,
|
||||
unsigned char prefixlen);
|
||||
int sd_radv_prefix_set_onlink(sd_radv_prefix *p, int onlink);
|
||||
int sd_radv_prefix_set_address_autoconfiguration(sd_radv_prefix *p,
|
||||
|
Loading…
Reference in New Issue
Block a user