1
0
mirror of https://github.com/systemd/systemd synced 2025-09-28 00:04:47 +02:00

Compare commits

..

5 Commits

Author SHA1 Message Date
Yu Watanabe
983cbd91a8 udev: add missing short option name
Follow-up for 4fcc033b5476039a7a8030e1edc261d42cec028b.

Fixes CID#1442307.
2021-01-13 21:53:13 +01:00
Lennart Poettering
ce0079d75e
Merge pull request #18227 from yuwata/network-dhcp6-pd-manage-temporary-address
network: introduce ManageTemporaryAddress= setting in [DHCPv6PrefixDelegation] section
2021-01-13 21:52:44 +01:00
krissgjeng
984aaaa3c6
hwdb: add Linx Vision 8 rotation information (#18228) 2021-01-13 21:52:11 +01:00
Yu Watanabe
fec1b650ad network: introduce ManageTemporaryAddress= setting in [DHCPv6PrefixDelegation] section
The setting is enabled by default, as NDisc also enabled the flag by
default.

Closes #18208.
2021-01-14 00:17:05 +09:00
Yu Watanabe
8b76ee89d7 network: drop a function argument which is always constant 2021-01-14 00:16:10 +09:00
8 changed files with 34 additions and 16 deletions

View File

@ -525,8 +525,9 @@ sensor:modalias:acpi:*BOSC0200*:dmi:*:svnLENOVO*:pn80U1:*
sensor:modalias:acpi:BOSC0200*:dmi:*:svnLINX*:pnLINX1010B:* sensor:modalias:acpi:BOSC0200*:dmi:*:svnLINX*:pnLINX1010B:*
ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 0, 0, -1 ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 0, 0, -1
# Linx 12X64 and 12V64 # Linx 12X64, 12V64 and Vision 8
sensor:modalias:acpi:KIOX000A*:dmi:*:svnLINX*:pnLINX12*64:* sensor:modalias:acpi:KIOX000A*:dmi:*:svnLINX*:pnLINX12*64:*
sensor:modalias:acpi:KIOX000A*:dmi:*:svnLINX:pnVISION004:*
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1 ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
######################################### #########################################

View File

@ -1081,11 +1081,11 @@ IPv6Token=prefixstable:2002:da8:1::</programlisting></para>
<listitem> <listitem>
<para>Takes a boolean. If true the kernel manage temporary addresses created <para>Takes a boolean. If true the kernel manage temporary addresses created
from this one as template on behalf of Privacy Extensions from this one as template on behalf of Privacy Extensions
<ulink url="https://tools.ietf.org/html/rfc3041">RFC 3041</ulink>. For this to become <ulink url="https://tools.ietf.org/html/rfc3041">RFC 3041</ulink>. For this to become
active, the use_tempaddr sysctl setting has to be set to a value greater than zero. active, the use_tempaddr sysctl setting has to be set to a value greater than zero.
The given address needs to have a prefix length of 64. This flag allows using privacy The given address needs to have a prefix length of 64. This flag allows using privacy
extensions in a manually configured network, just like if stateless auto-configuration extensions in a manually configured network, just like if stateless auto-configuration
was active. Defaults to false. </para> was active. Defaults to false.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
@ -2056,6 +2056,13 @@ IPv6Token=prefixstable:2002:da8:1::</programlisting></para>
addresses. Defaults to unset.</para> addresses. Defaults to unset.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>ManageTemporaryAddress=</varname></term>
<listitem>
<para>As in the [Address] section, but defaults to true.</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</refsect1> </refsect1>

View File

@ -365,11 +365,11 @@ static int dhcp6_pd_address_handler(sd_netlink *rtnl, sd_netlink_message *m, Lin
return 1; return 1;
} }
static int dhcp6_set_pd_address(Link *link, static int dhcp6_set_pd_address(
const union in_addr_union *prefix, Link *link,
uint8_t prefix_len, const union in_addr_union *prefix,
uint32_t lifetime_preferred, uint32_t lifetime_preferred,
uint32_t lifetime_valid) { uint32_t lifetime_valid) {
_cleanup_(address_freep) Address *address = NULL; _cleanup_(address_freep) Address *address = NULL;
Address *ret; Address *ret;
@ -396,10 +396,11 @@ static int dhcp6_set_pd_address(Link *link,
return log_link_warning_errno(link, r, "Failed to generate EUI64 address for acquired DHCPv6 delegated prefix: %m"); return log_link_warning_errno(link, r, "Failed to generate EUI64 address for acquired DHCPv6 delegated prefix: %m");
} }
address->prefixlen = prefix_len; address->prefixlen = 64;
address->family = AF_INET6; address->family = AF_INET6;
address->cinfo.ifa_prefered = lifetime_preferred; address->cinfo.ifa_prefered = lifetime_preferred;
address->cinfo.ifa_valid = lifetime_valid; address->cinfo.ifa_valid = lifetime_valid;
SET_FLAG(address->flags, IFA_F_MANAGETEMPADDR, link->network->dhcp6_pd_manage_temporary_address);
r = address_configure(address, link, dhcp6_pd_address_handler, true, &ret); r = address_configure(address, link, dhcp6_pd_address_handler, true, &ret);
if (r < 0) if (r < 0)
@ -416,8 +417,13 @@ static int dhcp6_set_pd_address(Link *link,
return 0; return 0;
} }
static int dhcp6_pd_assign_prefix(Link *link, const union in_addr_union *prefix, const union in_addr_union *pd_prefix, static int dhcp6_pd_assign_prefix(
uint8_t prefix_len, uint32_t lifetime_preferred, uint32_t lifetime_valid) { Link *link,
const union in_addr_union *prefix,
const union in_addr_union *pd_prefix,
uint32_t lifetime_preferred,
uint32_t lifetime_valid) {
int r; int r;
assert(link); assert(link);
@ -425,7 +431,7 @@ static int dhcp6_pd_assign_prefix(Link *link, const union in_addr_union *prefix,
assert(prefix); assert(prefix);
if (link->network->dhcp6_pd_announce) { if (link->network->dhcp6_pd_announce) {
r = radv_add_prefix(link, &prefix->in6, prefix_len, lifetime_preferred, lifetime_valid); r = radv_add_prefix(link, &prefix->in6, 64, lifetime_preferred, lifetime_valid);
if (r < 0) if (r < 0)
return r; return r;
} }
@ -434,7 +440,7 @@ static int dhcp6_pd_assign_prefix(Link *link, const union in_addr_union *prefix,
if (r < 0) if (r < 0)
return r; return r;
r = dhcp6_set_pd_address(link, prefix, prefix_len, lifetime_preferred, lifetime_valid); r = dhcp6_set_pd_address(link, prefix, lifetime_preferred, lifetime_valid);
if (r < 0) if (r < 0)
return r; return r;
@ -559,7 +565,7 @@ static void dhcp6_pd_prefix_distribute(Link *dhcp6_link,
} }
(void) in_addr_to_string(AF_INET6, &assigned_prefix, &assigned_buf); (void) in_addr_to_string(AF_INET6, &assigned_prefix, &assigned_buf);
r = dhcp6_pd_assign_prefix(link, &assigned_prefix, masked_pd_prefix, 64, r = dhcp6_pd_assign_prefix(link, &assigned_prefix, masked_pd_prefix,
lifetime_preferred, lifetime_valid); lifetime_preferred, lifetime_valid);
if (r < 0) { if (r < 0) {
log_link_error_errno(link, r, "Unable to assign/update prefix %s/64: %m", log_link_error_errno(link, r, "Unable to assign/update prefix %s/64: %m",

View File

@ -295,6 +295,7 @@ BridgeVLAN.EgressUntagged, config_parse_brvlan_untagged,
DHCPv6PrefixDelegation.SubnetId, config_parse_dhcp6_pd_subnet_id, 0, offsetof(Network, dhcp6_pd_subnet_id) DHCPv6PrefixDelegation.SubnetId, config_parse_dhcp6_pd_subnet_id, 0, offsetof(Network, dhcp6_pd_subnet_id)
DHCPv6PrefixDelegation.Announce, config_parse_bool, 0, offsetof(Network, dhcp6_pd_announce) DHCPv6PrefixDelegation.Announce, config_parse_bool, 0, offsetof(Network, dhcp6_pd_announce)
DHCPv6PrefixDelegation.Assign, config_parse_bool, 0, offsetof(Network, dhcp6_pd_assign) DHCPv6PrefixDelegation.Assign, config_parse_bool, 0, offsetof(Network, dhcp6_pd_assign)
DHCPv6PrefixDelegation.ManageTemporaryAddress, config_parse_bool, 0, offsetof(Network, dhcp6_pd_manage_temporary_address)
DHCPv6PrefixDelegation.Token, config_parse_dhcp6_pd_token, 0, offsetof(Network, dhcp6_pd_token) DHCPv6PrefixDelegation.Token, config_parse_dhcp6_pd_token, 0, offsetof(Network, dhcp6_pd_token)
IPv6SendRA.RouterLifetimeSec, config_parse_sec, 0, offsetof(Network, router_lifetime_usec) IPv6SendRA.RouterLifetimeSec, config_parse_sec, 0, offsetof(Network, router_lifetime_usec)
IPv6SendRA.Managed, config_parse_bool, 0, offsetof(Network, router_managed) IPv6SendRA.Managed, config_parse_bool, 0, offsetof(Network, router_managed)

View File

@ -361,6 +361,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
.dhcp6_pd = -1, .dhcp6_pd = -1,
.dhcp6_pd_announce = true, .dhcp6_pd_announce = true,
.dhcp6_pd_assign = true, .dhcp6_pd_assign = true,
.dhcp6_pd_manage_temporary_address = true,
.dhcp6_pd_subnet_id = -1, .dhcp6_pd_subnet_id = -1,
.dhcp_server_emit[SD_DHCP_LEASE_DNS].emit = true, .dhcp_server_emit[SD_DHCP_LEASE_DNS].emit = true,

View File

@ -200,6 +200,7 @@ struct Network {
int dhcp6_pd; int dhcp6_pd;
bool dhcp6_pd_announce; bool dhcp6_pd_announce;
bool dhcp6_pd_assign; bool dhcp6_pd_assign;
bool dhcp6_pd_manage_temporary_address;
int64_t dhcp6_pd_subnet_id; int64_t dhcp6_pd_subnet_id;
union in_addr_union dhcp6_pd_token; union in_addr_union dhcp6_pd_token;

View File

@ -239,7 +239,7 @@ static int builtin_blkid(sd_device *dev, int argc, char *argv[], bool test) {
static const struct option options[] = { static const struct option options[] = {
{ "offset", required_argument, NULL, 'o' }, { "offset", required_argument, NULL, 'o' },
{ "hint", required_argument, NULL, 'H' }, { "hint", required_argument, NULL, 'H' },
{ "noraid", no_argument, NULL, 'R' }, { "noraid", no_argument, NULL, 'R' },
{} {}
}; };
@ -251,7 +251,7 @@ static int builtin_blkid(sd_device *dev, int argc, char *argv[], bool test) {
for (;;) { for (;;) {
int option; int option;
option = getopt_long(argc, argv, "o:R", options, NULL); option = getopt_long(argc, argv, "o:H:R", options, NULL);
if (option == -1) if (option == -1)
break; break;

View File

@ -143,6 +143,7 @@ RouteMetric=
SubnetId= SubnetId=
Announce= Announce=
Assign= Assign=
ManageTemporaryAddress=
Token= Token=
[Route] [Route]
Destination= Destination=