mirror of
https://github.com/systemd/systemd
synced 2025-10-07 04:34:45 +02:00
Compare commits
7 Commits
b5a80aa9d8
...
b204bdd4cc
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b204bdd4cc | ||
![]() |
5c078687dc | ||
![]() |
1065501406 | ||
![]() |
a8fd92b5a3 | ||
![]() |
080e5c2fde | ||
![]() |
942cf4b8d1 | ||
![]() |
a78f938aaf |
@ -602,7 +602,7 @@ int dhcp6_option_parse_ia(sd_dhcp6_client *client, DHCP6Option *iaoption, DHCP6I
|
|||||||
|
|
||||||
case SD_DHCP6_OPTION_IA_PD_PREFIX:
|
case SD_DHCP6_OPTION_IA_PD_PREFIX:
|
||||||
|
|
||||||
if (!IN_SET(ia->type, SD_DHCP6_OPTION_IA_PD))
|
if (ia->type != SD_DHCP6_OPTION_IA_PD)
|
||||||
return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(EINVAL),
|
return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(EINVAL),
|
||||||
"IA PD Prefix option not in IA PD option");
|
"IA PD Prefix option not in IA PD option");
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ int sd_dhcp6_client_set_callback(
|
|||||||
int sd_dhcp6_client_set_ifindex(sd_dhcp6_client *client, int ifindex) {
|
int sd_dhcp6_client_set_ifindex(sd_dhcp6_client *client, int ifindex) {
|
||||||
assert_return(client, -EINVAL);
|
assert_return(client, -EINVAL);
|
||||||
assert_return(ifindex > 0, -EINVAL);
|
assert_return(ifindex > 0, -EINVAL);
|
||||||
assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY);
|
assert_return(client->state == DHCP6_STATE_STOPPED, -EBUSY);
|
||||||
|
|
||||||
client->ifindex = ifindex;
|
client->ifindex = ifindex;
|
||||||
return 0;
|
return 0;
|
||||||
@ -191,8 +191,7 @@ int sd_dhcp6_client_set_local_address(
|
|||||||
assert_return(client, -EINVAL);
|
assert_return(client, -EINVAL);
|
||||||
assert_return(local_address, -EINVAL);
|
assert_return(local_address, -EINVAL);
|
||||||
assert_return(in6_addr_is_link_local(local_address) > 0, -EINVAL);
|
assert_return(in6_addr_is_link_local(local_address) > 0, -EINVAL);
|
||||||
|
assert_return(client->state == DHCP6_STATE_STOPPED, -EBUSY);
|
||||||
assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY);
|
|
||||||
|
|
||||||
client->local_address = *local_address;
|
client->local_address = *local_address;
|
||||||
|
|
||||||
@ -207,8 +206,7 @@ int sd_dhcp6_client_set_mac(
|
|||||||
assert_return(client, -EINVAL);
|
assert_return(client, -EINVAL);
|
||||||
assert_return(addr, -EINVAL);
|
assert_return(addr, -EINVAL);
|
||||||
assert_return(addr_len <= MAX_MAC_ADDR_LEN, -EINVAL);
|
assert_return(addr_len <= MAX_MAC_ADDR_LEN, -EINVAL);
|
||||||
|
assert_return(client->state == DHCP6_STATE_STOPPED, -EBUSY);
|
||||||
assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY);
|
|
||||||
|
|
||||||
if (arp_type == ARPHRD_ETHER)
|
if (arp_type == ARPHRD_ETHER)
|
||||||
assert_return(addr_len == ETH_ALEN, -EINVAL);
|
assert_return(addr_len == ETH_ALEN, -EINVAL);
|
||||||
@ -238,8 +236,7 @@ int sd_dhcp6_client_set_prefix_delegation_hint(
|
|||||||
|
|
||||||
assert_return(client, -EINVAL);
|
assert_return(client, -EINVAL);
|
||||||
assert_return(pd_address, -EINVAL);
|
assert_return(pd_address, -EINVAL);
|
||||||
|
assert_return(client->state == DHCP6_STATE_STOPPED, -EBUSY);
|
||||||
assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY);
|
|
||||||
|
|
||||||
client->hint_pd_prefix.iapdprefix.address = *pd_address;
|
client->hint_pd_prefix.iapdprefix.address = *pd_address;
|
||||||
client->hint_pd_prefix.iapdprefix.prefixlen = prefixlen;
|
client->hint_pd_prefix.iapdprefix.prefixlen = prefixlen;
|
||||||
@ -284,7 +281,7 @@ static int dhcp6_client_set_duid_internal(
|
|||||||
|
|
||||||
assert_return(client, -EINVAL);
|
assert_return(client, -EINVAL);
|
||||||
assert_return(duid_len == 0 || duid != NULL, -EINVAL);
|
assert_return(duid_len == 0 || duid != NULL, -EINVAL);
|
||||||
assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY);
|
assert_return(client->state == DHCP6_STATE_STOPPED, -EBUSY);
|
||||||
|
|
||||||
if (duid) {
|
if (duid) {
|
||||||
r = dhcp_validate_duid_len(duid_type, duid_len, true);
|
r = dhcp_validate_duid_len(duid_type, duid_len, true);
|
||||||
@ -393,7 +390,7 @@ int sd_dhcp6_client_duid_as_string(
|
|||||||
|
|
||||||
int sd_dhcp6_client_set_iaid(sd_dhcp6_client *client, uint32_t iaid) {
|
int sd_dhcp6_client_set_iaid(sd_dhcp6_client *client, uint32_t iaid) {
|
||||||
assert_return(client, -EINVAL);
|
assert_return(client, -EINVAL);
|
||||||
assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY);
|
assert_return(client->state == DHCP6_STATE_STOPPED, -EBUSY);
|
||||||
|
|
||||||
client->ia_na.ia_na.id = htobe32(iaid);
|
client->ia_na.ia_na.id = htobe32(iaid);
|
||||||
client->ia_pd.ia_pd.id = htobe32(iaid);
|
client->ia_pd.ia_pd.id = htobe32(iaid);
|
||||||
@ -430,7 +427,7 @@ int sd_dhcp6_client_set_fqdn(
|
|||||||
|
|
||||||
int sd_dhcp6_client_set_information_request(sd_dhcp6_client *client, int enabled) {
|
int sd_dhcp6_client_set_information_request(sd_dhcp6_client *client, int enabled) {
|
||||||
assert_return(client, -EINVAL);
|
assert_return(client, -EINVAL);
|
||||||
assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY);
|
assert_return(client->state == DHCP6_STATE_STOPPED, -EBUSY);
|
||||||
|
|
||||||
client->information_request = enabled;
|
client->information_request = enabled;
|
||||||
|
|
||||||
@ -1705,7 +1702,7 @@ int sd_dhcp6_client_start(sd_dhcp6_client *client) {
|
|||||||
assert_return(client->ifindex > 0, -EINVAL);
|
assert_return(client->ifindex > 0, -EINVAL);
|
||||||
assert_return(in6_addr_is_link_local(&client->local_address) > 0, -EINVAL);
|
assert_return(in6_addr_is_link_local(&client->local_address) > 0, -EINVAL);
|
||||||
|
|
||||||
if (!IN_SET(client->state, DHCP6_STATE_STOPPED))
|
if (client->state != DHCP6_STATE_STOPPED)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
if (!client->information_request && !client->request)
|
if (!client->information_request && !client->request)
|
||||||
|
@ -2202,7 +2202,7 @@ static int link_reconfigure_internal(Link *link, sd_netlink_message *m, bool for
|
|||||||
return r;
|
return r;
|
||||||
|
|
||||||
if (!IN_SET(link->state, LINK_STATE_UNMANAGED, LINK_STATE_PENDING, LINK_STATE_INITIALIZED)) {
|
if (!IN_SET(link->state, LINK_STATE_UNMANAGED, LINK_STATE_PENDING, LINK_STATE_INITIALIZED)) {
|
||||||
log_link_debug(link, "State is %s, dropping config", link_state_to_string(link->state));
|
log_link_debug(link, "State is %s, dropping foreign config", link_state_to_string(link->state));
|
||||||
r = link_drop_foreign_config(link);
|
r = link_drop_foreign_config(link);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
@ -2638,7 +2638,7 @@ static int link_carrier_lost(Link *link) {
|
|||||||
return r;
|
return r;
|
||||||
|
|
||||||
if (!IN_SET(link->state, LINK_STATE_UNMANAGED, LINK_STATE_PENDING, LINK_STATE_INITIALIZED)) {
|
if (!IN_SET(link->state, LINK_STATE_UNMANAGED, LINK_STATE_PENDING, LINK_STATE_INITIALIZED)) {
|
||||||
log_link_debug(link, "State is %s, dropping config", link_state_to_string(link->state));
|
log_link_debug(link, "State is %s, dropping foreign config", link_state_to_string(link->state));
|
||||||
r = link_drop_foreign_config(link);
|
r = link_drop_foreign_config(link);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
@ -28,9 +28,9 @@ struct Manager {
|
|||||||
Hashmap *polkit_registry;
|
Hashmap *polkit_registry;
|
||||||
int ethtool_fd;
|
int ethtool_fd;
|
||||||
|
|
||||||
bool enumerating:1;
|
bool enumerating;
|
||||||
bool dirty:1;
|
bool dirty;
|
||||||
bool restarting:1;
|
bool restarting;
|
||||||
bool manage_foreign_routes;
|
bool manage_foreign_routes;
|
||||||
|
|
||||||
Set *dirty_links;
|
Set *dirty_links;
|
||||||
|
@ -1315,7 +1315,9 @@ int ndisc_configure(Link *link) {
|
|||||||
if (!link_ipv6_accept_ra_enabled(link))
|
if (!link_ipv6_accept_ra_enabled(link))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!link->ndisc) {
|
if (link->ndisc)
|
||||||
|
return 0; /* Already configured. */
|
||||||
|
|
||||||
r = sd_ndisc_new(&link->ndisc);
|
r = sd_ndisc_new(&link->ndisc);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
@ -1323,7 +1325,6 @@ int ndisc_configure(Link *link) {
|
|||||||
r = sd_ndisc_attach_event(link->ndisc, link->manager->event, 0);
|
r = sd_ndisc_attach_event(link->ndisc, link->manager->event, 0);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
}
|
|
||||||
|
|
||||||
r = sd_ndisc_set_mac(link->ndisc, &link->hw_addr.addr.ether);
|
r = sd_ndisc_set_mac(link->ndisc, &link->hw_addr.addr.ether);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
|
@ -160,7 +160,10 @@ static int dns_trust_anchor_add_builtin_negative(DnsTrustAnchor *d) {
|
|||||||
"lan\0"
|
"lan\0"
|
||||||
"intranet\0"
|
"intranet\0"
|
||||||
"internal\0"
|
"internal\0"
|
||||||
"private\0";
|
"private\0"
|
||||||
|
|
||||||
|
/* Defined by RFC 8375. The most official choice. */
|
||||||
|
"home.arpa\0";
|
||||||
|
|
||||||
const char *name;
|
const char *name;
|
||||||
int r;
|
int r;
|
||||||
|
@ -46,7 +46,7 @@ int rsa_pkey_to_suitable_key_size(
|
|||||||
size_t *ret_suitable_key_size) {
|
size_t *ret_suitable_key_size) {
|
||||||
|
|
||||||
size_t suitable_key_size;
|
size_t suitable_key_size;
|
||||||
RSA *rsa;
|
const RSA *rsa;
|
||||||
int bits;
|
int bits;
|
||||||
|
|
||||||
assert_se(pkey);
|
assert_se(pkey);
|
||||||
|
@ -31,7 +31,7 @@ bool pkcs11_uri_valid(const char *uri) {
|
|||||||
if (isempty(p))
|
if (isempty(p))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!in_charset(p, ALPHANUMERICAL "-_?;&%="))
|
if (!in_charset(p, ALPHANUMERICAL ".~/-_?;&%="))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user