mirror of
https://github.com/systemd/systemd
synced 2025-12-26 19:04:45 +01:00
Compare commits
9 Commits
2ac4d1d45b
...
85b6a8110d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85b6a8110d | ||
|
|
882f5f429e | ||
|
|
5501da15ba | ||
|
|
766f8f388f | ||
|
|
e67b818c2f | ||
|
|
f7c87baeca | ||
|
|
3bacb7e73b | ||
|
|
06d98bdc81 | ||
|
|
ea2bc25762 |
@ -297,9 +297,10 @@
|
||||
|
||||
<listitem><para>Takes a boolean argument. If true, the time when the service unit was last triggered
|
||||
is stored on disk. When the timer is activated, the service unit is triggered immediately if it
|
||||
would have been triggered at least once during the time when the timer was inactive. This is useful
|
||||
to catch up on missed runs of the service when the system was powered down. Note that this setting
|
||||
only has an effect on timers configured with <varname>OnCalendar=</varname>. Defaults to
|
||||
would have been triggered at least once during the time when the timer was inactive. Such triggering
|
||||
is nonetheless subject to the delay imposed by <varname>RandomizedDelaySec=</varname>.
|
||||
This is useful to catch up on missed runs of the service when the system was powered down. Note that
|
||||
this setting only has an effect on timers configured with <varname>OnCalendar=</varname>. Defaults to
|
||||
<varname>false</varname>.</para>
|
||||
|
||||
<para>Use <command>systemctl clean --what=state …</command> on the timer unit to remove the timestamp
|
||||
|
||||
@ -261,17 +261,13 @@ static int get_max_brightness(sd_device *device, unsigned *ret) {
|
||||
* max_brightness in case of 'backlight' subsystem. This avoids preserving
|
||||
* an unreadably dim screen, which would otherwise force the user to
|
||||
* disable state restoration. */
|
||||
static int clamp_brightness(sd_device *device, char **value, unsigned max_brightness) {
|
||||
unsigned brightness, new_brightness, min_brightness;
|
||||
static int clamp_brightness(sd_device *device, bool saved, unsigned max_brightness, unsigned *brightness) {
|
||||
unsigned new_brightness, min_brightness;
|
||||
const char *subsystem;
|
||||
int r;
|
||||
|
||||
assert(value);
|
||||
assert(*value);
|
||||
|
||||
r = safe_atou(*value, &brightness);
|
||||
if (r < 0)
|
||||
return log_device_warning_errno(device, r, "Failed to parse brightness \"%s\": %m", *value);
|
||||
assert(device);
|
||||
assert(brightness);
|
||||
|
||||
r = sd_device_get_subsystem(device, &subsystem);
|
||||
if (r < 0)
|
||||
@ -282,22 +278,16 @@ static int clamp_brightness(sd_device *device, char **value, unsigned max_bright
|
||||
else
|
||||
min_brightness = 0;
|
||||
|
||||
new_brightness = CLAMP(brightness, min_brightness, max_brightness);
|
||||
if (new_brightness != brightness) {
|
||||
char *new_value;
|
||||
|
||||
r = asprintf(&new_value, "%u", new_brightness);
|
||||
if (r < 0)
|
||||
return log_oom();
|
||||
|
||||
log_device_info(device, "Saved brightness %s %s to %s.", *value,
|
||||
new_brightness > brightness ?
|
||||
new_brightness = CLAMP(*brightness, min_brightness, max_brightness);
|
||||
if (new_brightness != *brightness)
|
||||
log_device_info(device, "%s brightness %u is %s to %u.",
|
||||
saved ? "Saved" : "Current",
|
||||
*brightness,
|
||||
new_brightness > *brightness ?
|
||||
"too low; increasing" : "too high; decreasing",
|
||||
new_value);
|
||||
|
||||
free_and_replace(*value, new_value);
|
||||
}
|
||||
new_brightness);
|
||||
|
||||
*brightness = new_brightness;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -309,7 +299,8 @@ static bool shall_clamp(sd_device *d) {
|
||||
|
||||
r = sd_device_get_property_value(d, "ID_BACKLIGHT_CLAMP", &s);
|
||||
if (r < 0) {
|
||||
log_device_debug_errno(d, r, "Failed to get ID_BACKLIGHT_CLAMP property, ignoring: %m");
|
||||
if (r != -ENOENT)
|
||||
log_device_debug_errno(d, r, "Failed to get ID_BACKLIGHT_CLAMP property, ignoring: %m");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -322,31 +313,60 @@ static bool shall_clamp(sd_device *d) {
|
||||
return r;
|
||||
}
|
||||
|
||||
static int read_brightness(sd_device *device, const char **ret) {
|
||||
const char *subsystem;
|
||||
static int read_brightness(sd_device *device, unsigned max_brightness, unsigned *ret_brightness) {
|
||||
const char *subsystem, *value;
|
||||
unsigned brightness;
|
||||
int r;
|
||||
|
||||
assert(device);
|
||||
assert(ret);
|
||||
assert(ret_brightness);
|
||||
|
||||
r = sd_device_get_subsystem(device, &subsystem);
|
||||
if (r < 0)
|
||||
return log_device_debug_errno(device, r, "Failed to get subsystem: %m");
|
||||
|
||||
if (streq(subsystem, "backlight")) {
|
||||
r = sd_device_get_sysattr_value(device, "actual_brightness", ret);
|
||||
if (r >= 0)
|
||||
return 0;
|
||||
if (r != -ENOENT)
|
||||
r = sd_device_get_sysattr_value(device, "actual_brightness", &value);
|
||||
if (r == -ENOENT) {
|
||||
log_device_debug_errno(device, r, "Failed to read 'actual_brightness' attribute, "
|
||||
"fall back to use 'brightness' attribute: %m");
|
||||
goto use_brightness;
|
||||
}
|
||||
if (r < 0)
|
||||
return log_device_debug_errno(device, r, "Failed to read 'actual_brightness' attribute: %m");
|
||||
|
||||
log_device_debug_errno(device, r, "Failed to read 'actual_brightness' attribute, fall back to use 'brightness' attribute: %m");
|
||||
r = safe_atou(value, &brightness);
|
||||
if (r < 0) {
|
||||
log_device_debug_errno(device, r, "Failed to parse 'actual_brightness' attribute, "
|
||||
"fall back to use 'brightness' attribute: %s", value);
|
||||
goto use_brightness;
|
||||
}
|
||||
|
||||
if (brightness > max_brightness) {
|
||||
log_device_debug(device, "actual_brightness=%u is larger than max_brightness=%u, "
|
||||
"fall back to use 'brightness' attribute", brightness, max_brightness);
|
||||
goto use_brightness;
|
||||
}
|
||||
|
||||
*ret_brightness = brightness;
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = sd_device_get_sysattr_value(device, "brightness", ret);
|
||||
use_brightness:
|
||||
r = sd_device_get_sysattr_value(device, "brightness", &value);
|
||||
if (r < 0)
|
||||
return log_device_debug_errno(device, r, "Failed to read 'brightness' attribute: %m");
|
||||
|
||||
r = safe_atou(value, &brightness);
|
||||
if (r < 0)
|
||||
return log_device_debug_errno(device, r, "Failed to parse 'brightness' attribute: %s", value);
|
||||
|
||||
if (brightness > max_brightness)
|
||||
return log_device_debug_errno(device, SYNTHETIC_ERRNO(EINVAL),
|
||||
"brightness=%u is larger than max_brightness=%u",
|
||||
brightness, max_brightness);
|
||||
|
||||
*ret_brightness = brightness;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -354,7 +374,7 @@ static int run(int argc, char *argv[]) {
|
||||
_cleanup_(sd_device_unrefp) sd_device *device = NULL;
|
||||
_cleanup_free_ char *escaped_ss = NULL, *escaped_sysname = NULL, *escaped_path_id = NULL;
|
||||
const char *sysname, *path_id, *ss, *saved;
|
||||
unsigned max_brightness;
|
||||
unsigned max_brightness, brightness;
|
||||
int r;
|
||||
|
||||
log_setup_service();
|
||||
@ -431,44 +451,50 @@ static int run(int argc, char *argv[]) {
|
||||
clamp = shall_clamp(device);
|
||||
|
||||
r = read_one_line_file(saved, &value);
|
||||
if (IN_SET(r, -ENOENT, 0)) {
|
||||
const char *curval;
|
||||
if (r < 0 && r != -ENOENT)
|
||||
return log_error_errno(r, "Failed to read %s: %m", saved);
|
||||
if (r > 0) {
|
||||
r = safe_atou(value, &brightness);
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to parse saved brightness '%s', removing %s.",
|
||||
value, saved);
|
||||
(void) unlink(saved);
|
||||
} else {
|
||||
if (clamp)
|
||||
(void) clamp_brightness(device, true, max_brightness, &brightness);
|
||||
|
||||
/* Fallback to clamping current brightness or exit early if
|
||||
* clamping is not supported/enabled. */
|
||||
/* Do not fall back to read current brightness below. */
|
||||
r = 1;
|
||||
}
|
||||
}
|
||||
if (r <= 0) {
|
||||
/* Fallback to clamping current brightness or exit early if clamping is not
|
||||
* supported/enabled. */
|
||||
if (!clamp)
|
||||
return 0;
|
||||
|
||||
r = read_brightness(device, &curval);
|
||||
r = read_brightness(device, max_brightness, &brightness);
|
||||
if (r < 0)
|
||||
return log_device_error_errno(device, r, "Failed to read current brightness: %m");
|
||||
|
||||
value = strdup(curval);
|
||||
if (!value)
|
||||
return log_oom();
|
||||
} else if (r < 0)
|
||||
return log_error_errno(r, "Failed to read %s: %m", saved);
|
||||
(void) clamp_brightness(device, false, max_brightness, &brightness);
|
||||
}
|
||||
|
||||
if (clamp)
|
||||
(void) clamp_brightness(device, &value, max_brightness);
|
||||
|
||||
r = sd_device_set_sysattr_value(device, "brightness", value);
|
||||
r = sd_device_set_sysattr_valuef(device, "brightness", "%u", brightness);
|
||||
if (r < 0)
|
||||
return log_device_error_errno(device, r, "Failed to write system 'brightness' attribute: %m");
|
||||
|
||||
} else if (streq(argv[1], "save")) {
|
||||
const char *value;
|
||||
|
||||
if (validate_device(device) == 0) {
|
||||
(void) unlink(saved);
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = read_brightness(device, &value);
|
||||
r = read_brightness(device, max_brightness, &brightness);
|
||||
if (r < 0)
|
||||
return log_device_error_errno(device, r, "Failed to read current brightness: %m");
|
||||
|
||||
r = write_string_file(saved, value, WRITE_STRING_FILE_CREATE);
|
||||
r = write_string_filef(saved, WRITE_STRING_FILE_CREATE, "%u", brightness);
|
||||
if (r < 0)
|
||||
return log_device_error_errno(device, r, "Failed to write %s: %m", saved);
|
||||
|
||||
|
||||
@ -181,6 +181,47 @@ static int generate_keydev_mount(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int generate_keydev_umount(const char *name,
|
||||
const char *keydev_mount,
|
||||
char **ret_umount_unit) {
|
||||
_cleanup_fclose_ FILE *f = NULL;
|
||||
_cleanup_free_ char *u = NULL, *name_escaped = NULL, *mount = NULL;
|
||||
int r;
|
||||
|
||||
assert(name);
|
||||
assert(ret_umount_unit);
|
||||
|
||||
name_escaped = cescape(name);
|
||||
if (!name_escaped)
|
||||
return -ENOMEM;
|
||||
|
||||
u = strjoin("keydev-", name_escaped, "-umount.service");
|
||||
if (!u)
|
||||
return -ENOMEM;
|
||||
|
||||
r = unit_name_from_path(keydev_mount, ".mount", &mount);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = generator_open_unit_file(arg_dest, NULL, u, &f);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
fprintf(f,
|
||||
"[Unit]\n"
|
||||
"DefaultDependencies=no\n"
|
||||
"After=%s\n\n"
|
||||
"[Service]\n"
|
||||
"ExecStart=-" UMOUNT_PATH " %s\n\n", mount, keydev_mount);
|
||||
|
||||
r = fflush_and_check(f);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
*ret_umount_unit = TAKE_PTR(u);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int print_dependencies(FILE *f, const char* device_path) {
|
||||
int r;
|
||||
|
||||
@ -314,12 +355,16 @@ static int create_disk(
|
||||
fprintf(f, "Conflicts=umount.target\n");
|
||||
|
||||
if (keydev) {
|
||||
_cleanup_free_ char *unit = NULL;
|
||||
_cleanup_free_ char *unit = NULL, *umount_unit = NULL;
|
||||
|
||||
r = generate_keydev_mount(name, keydev, keyfile_timeout_value, keyfile_can_timeout > 0, &unit, &keydev_mount);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to generate keydev mount unit: %m");
|
||||
|
||||
r = generate_keydev_umount(name, keydev_mount, &umount_unit);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to generate keydev umount unit: %m");
|
||||
|
||||
password_buffer = path_join(keydev_mount, password);
|
||||
if (!password_buffer)
|
||||
return log_oom();
|
||||
@ -331,6 +376,15 @@ static int create_disk(
|
||||
fprintf(f, "Wants=%s\n", unit);
|
||||
else
|
||||
fprintf(f, "Requires=%s\n", unit);
|
||||
|
||||
if (umount_unit) {
|
||||
fprintf(f,
|
||||
"Wants=%s\n"
|
||||
"Before=%s\n",
|
||||
umount_unit,
|
||||
umount_unit
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!nofail)
|
||||
@ -394,11 +448,6 @@ static int create_disk(
|
||||
"ExecStartPost=" ROOTLIBEXECDIR "/systemd-makefs swap '/dev/mapper/%s'\n",
|
||||
name_escaped);
|
||||
|
||||
if (keydev)
|
||||
fprintf(f,
|
||||
"ExecStartPost=-" UMOUNT_PATH " %s\n\n",
|
||||
keydev_mount);
|
||||
|
||||
r = fflush_and_check(f);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to write unit file %s: %m", n);
|
||||
|
||||
@ -732,4 +732,5 @@ global:
|
||||
sd_device_get_current_tag_first;
|
||||
sd_device_get_current_tag_next;
|
||||
sd_device_has_current_tag;
|
||||
sd_device_set_sysattr_valuef;
|
||||
} LIBSYSTEMD_246;
|
||||
|
||||
@ -1979,3 +1979,26 @@ _public_ int sd_device_set_sysattr_value(sd_device *device, const char *sysattr,
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
_public_ int sd_device_set_sysattr_valuef(sd_device *device, const char *sysattr, const char *format, ...) {
|
||||
_cleanup_free_ char *value = NULL;
|
||||
va_list ap;
|
||||
int r;
|
||||
|
||||
assert_return(device, -EINVAL);
|
||||
assert_return(sysattr, -EINVAL);
|
||||
|
||||
if (!format) {
|
||||
device_remove_sysattr_value(device, sysattr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
va_start(ap, format);
|
||||
r = vasprintf(&value, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (r < 0)
|
||||
return -ENOMEM;
|
||||
|
||||
return sd_device_set_sysattr_value(device, sysattr, value);
|
||||
}
|
||||
|
||||
@ -158,7 +158,8 @@ static int dhcp6_pd_remove_old(Link *link, bool force) {
|
||||
if (k < 0)
|
||||
r = k;
|
||||
|
||||
(void) sd_radv_remove_prefix(link->radv, &route->dst.in6, 64);
|
||||
if (link->radv)
|
||||
(void) sd_radv_remove_prefix(link->radv, &route->dst.in6, 64);
|
||||
dhcp6_pd_free(hashmap_get(link->manager->dhcp6_prefixes, &route->dst.in6));
|
||||
}
|
||||
|
||||
@ -198,7 +199,8 @@ int dhcp6_pd_remove(Link *link) {
|
||||
if (k < 0)
|
||||
r = k;
|
||||
|
||||
(void) sd_radv_remove_prefix(link->radv, &route->dst.in6, 64);
|
||||
if (link->radv)
|
||||
(void) sd_radv_remove_prefix(link->radv, &route->dst.in6, 64);
|
||||
dhcp6_pd_free(hashmap_get(link->manager->dhcp6_prefixes, &route->dst.in6));
|
||||
}
|
||||
|
||||
|
||||
@ -681,7 +681,9 @@ int radv_add_prefix(Link *link, const struct in6_addr *prefix, uint8_t prefix_le
|
||||
int r;
|
||||
|
||||
assert(link);
|
||||
assert(link->radv);
|
||||
|
||||
if (!link->radv)
|
||||
return 0;
|
||||
|
||||
r = sd_radv_prefix_new(&p);
|
||||
if (r < 0)
|
||||
|
||||
@ -79,6 +79,7 @@ int sd_device_get_property_value(sd_device *device, const char *key, const char
|
||||
int sd_device_get_sysattr_value(sd_device *device, const char *sysattr, const char **_value);
|
||||
|
||||
int sd_device_set_sysattr_value(sd_device *device, const char *sysattr, const char *value);
|
||||
int sd_device_set_sysattr_valuef(sd_device *device, const char *sysattr, const char *format, ...) _sd_printf_(3, 4);
|
||||
|
||||
/* device enumerator */
|
||||
|
||||
|
||||
@ -51,3 +51,261 @@ Peer=2001:db8:0:f103::10/128
|
||||
|
||||
[Address]
|
||||
Address=::/64
|
||||
|
||||
# test for ENOBUFS issue #17012
|
||||
[Network]
|
||||
Address=10.3.3.1/16
|
||||
Address=10.3.3.2/16
|
||||
Address=10.3.3.3/16
|
||||
Address=10.3.3.4/16
|
||||
Address=10.3.3.5/16
|
||||
Address=10.3.3.6/16
|
||||
Address=10.3.3.7/16
|
||||
Address=10.3.3.8/16
|
||||
Address=10.3.3.9/16
|
||||
Address=10.3.3.10/16
|
||||
Address=10.3.3.11/16
|
||||
Address=10.3.3.12/16
|
||||
Address=10.3.3.13/16
|
||||
Address=10.3.3.14/16
|
||||
Address=10.3.3.15/16
|
||||
Address=10.3.3.16/16
|
||||
Address=10.3.3.17/16
|
||||
Address=10.3.3.18/16
|
||||
Address=10.3.3.19/16
|
||||
Address=10.3.3.20/16
|
||||
Address=10.3.3.21/16
|
||||
Address=10.3.3.22/16
|
||||
Address=10.3.3.23/16
|
||||
Address=10.3.3.24/16
|
||||
Address=10.3.3.25/16
|
||||
Address=10.3.3.26/16
|
||||
Address=10.3.3.27/16
|
||||
Address=10.3.3.28/16
|
||||
Address=10.3.3.29/16
|
||||
Address=10.3.3.30/16
|
||||
Address=10.3.3.31/16
|
||||
Address=10.3.3.32/16
|
||||
Address=10.3.3.33/16
|
||||
Address=10.3.3.34/16
|
||||
Address=10.3.3.35/16
|
||||
Address=10.3.3.36/16
|
||||
Address=10.3.3.37/16
|
||||
Address=10.3.3.38/16
|
||||
Address=10.3.3.39/16
|
||||
Address=10.3.3.40/16
|
||||
Address=10.3.3.41/16
|
||||
Address=10.3.3.42/16
|
||||
Address=10.3.3.43/16
|
||||
Address=10.3.3.44/16
|
||||
Address=10.3.3.45/16
|
||||
Address=10.3.3.46/16
|
||||
Address=10.3.3.47/16
|
||||
Address=10.3.3.48/16
|
||||
Address=10.3.3.49/16
|
||||
Address=10.3.3.50/16
|
||||
Address=10.3.3.51/16
|
||||
Address=10.3.3.52/16
|
||||
Address=10.3.3.53/16
|
||||
Address=10.3.3.54/16
|
||||
Address=10.3.3.55/16
|
||||
Address=10.3.3.56/16
|
||||
Address=10.3.3.57/16
|
||||
Address=10.3.3.58/16
|
||||
Address=10.3.3.59/16
|
||||
Address=10.3.3.60/16
|
||||
Address=10.3.3.61/16
|
||||
Address=10.3.3.62/16
|
||||
Address=10.3.3.63/16
|
||||
Address=10.3.3.64/16
|
||||
Address=10.3.3.65/16
|
||||
Address=10.3.3.66/16
|
||||
Address=10.3.3.67/16
|
||||
Address=10.3.3.68/16
|
||||
Address=10.3.3.69/16
|
||||
Address=10.3.3.70/16
|
||||
Address=10.3.3.71/16
|
||||
Address=10.3.3.72/16
|
||||
Address=10.3.3.73/16
|
||||
Address=10.3.3.74/16
|
||||
Address=10.3.3.75/16
|
||||
Address=10.3.3.76/16
|
||||
Address=10.3.3.77/16
|
||||
Address=10.3.3.78/16
|
||||
Address=10.3.3.79/16
|
||||
Address=10.3.3.80/16
|
||||
Address=10.3.3.81/16
|
||||
Address=10.3.3.82/16
|
||||
Address=10.3.3.83/16
|
||||
Address=10.3.3.84/16
|
||||
Address=10.3.3.85/16
|
||||
Address=10.3.3.86/16
|
||||
Address=10.3.3.87/16
|
||||
Address=10.3.3.88/16
|
||||
Address=10.3.3.89/16
|
||||
Address=10.3.3.90/16
|
||||
Address=10.3.3.91/16
|
||||
Address=10.3.3.92/16
|
||||
Address=10.3.3.93/16
|
||||
Address=10.3.3.94/16
|
||||
Address=10.3.3.95/16
|
||||
Address=10.3.3.96/16
|
||||
Address=10.3.3.97/16
|
||||
Address=10.3.3.98/16
|
||||
Address=10.3.3.99/16
|
||||
Address=10.3.3.100/16
|
||||
Address=10.3.3.101/16
|
||||
Address=10.3.3.101/16
|
||||
Address=10.3.3.102/16
|
||||
Address=10.3.3.103/16
|
||||
Address=10.3.3.104/16
|
||||
Address=10.3.3.105/16
|
||||
Address=10.3.3.106/16
|
||||
Address=10.3.3.107/16
|
||||
Address=10.3.3.108/16
|
||||
Address=10.3.3.109/16
|
||||
Address=10.3.3.110/16
|
||||
Address=10.3.3.111/16
|
||||
Address=10.3.3.112/16
|
||||
Address=10.3.3.113/16
|
||||
Address=10.3.3.114/16
|
||||
Address=10.3.3.115/16
|
||||
Address=10.3.3.116/16
|
||||
Address=10.3.3.117/16
|
||||
Address=10.3.3.118/16
|
||||
Address=10.3.3.119/16
|
||||
Address=10.3.3.120/16
|
||||
Address=10.3.3.121/16
|
||||
Address=10.3.3.122/16
|
||||
Address=10.3.3.123/16
|
||||
Address=10.3.3.124/16
|
||||
Address=10.3.3.125/16
|
||||
Address=10.3.3.126/16
|
||||
Address=10.3.3.127/16
|
||||
Address=10.3.3.128/16
|
||||
Address=10.3.3.129/16
|
||||
Address=10.3.3.130/16
|
||||
Address=10.3.3.131/16
|
||||
Address=10.3.3.132/16
|
||||
Address=10.3.3.133/16
|
||||
Address=10.3.3.134/16
|
||||
Address=10.3.3.135/16
|
||||
Address=10.3.3.136/16
|
||||
Address=10.3.3.137/16
|
||||
Address=10.3.3.138/16
|
||||
Address=10.3.3.139/16
|
||||
Address=10.3.3.140/16
|
||||
Address=10.3.3.141/16
|
||||
Address=10.3.3.142/16
|
||||
Address=10.3.3.143/16
|
||||
Address=10.3.3.144/16
|
||||
Address=10.3.3.145/16
|
||||
Address=10.3.3.146/16
|
||||
Address=10.3.3.147/16
|
||||
Address=10.3.3.148/16
|
||||
Address=10.3.3.149/16
|
||||
Address=10.3.3.150/16
|
||||
Address=10.3.3.151/16
|
||||
Address=10.3.3.152/16
|
||||
Address=10.3.3.153/16
|
||||
Address=10.3.3.154/16
|
||||
Address=10.3.3.155/16
|
||||
Address=10.3.3.156/16
|
||||
Address=10.3.3.157/16
|
||||
Address=10.3.3.158/16
|
||||
Address=10.3.3.159/16
|
||||
Address=10.3.3.160/16
|
||||
Address=10.3.3.161/16
|
||||
Address=10.3.3.162/16
|
||||
Address=10.3.3.163/16
|
||||
Address=10.3.3.164/16
|
||||
Address=10.3.3.165/16
|
||||
Address=10.3.3.166/16
|
||||
Address=10.3.3.167/16
|
||||
Address=10.3.3.168/16
|
||||
Address=10.3.3.169/16
|
||||
Address=10.3.3.170/16
|
||||
Address=10.3.3.171/16
|
||||
Address=10.3.3.172/16
|
||||
Address=10.3.3.173/16
|
||||
Address=10.3.3.174/16
|
||||
Address=10.3.3.175/16
|
||||
Address=10.3.3.176/16
|
||||
Address=10.3.3.177/16
|
||||
Address=10.3.3.178/16
|
||||
Address=10.3.3.179/16
|
||||
Address=10.3.3.180/16
|
||||
Address=10.3.3.181/16
|
||||
Address=10.3.3.182/16
|
||||
Address=10.3.3.183/16
|
||||
Address=10.3.3.184/16
|
||||
Address=10.3.3.185/16
|
||||
Address=10.3.3.186/16
|
||||
Address=10.3.3.187/16
|
||||
Address=10.3.3.188/16
|
||||
Address=10.3.3.189/16
|
||||
Address=10.3.3.190/16
|
||||
Address=10.3.3.191/16
|
||||
Address=10.3.3.192/16
|
||||
Address=10.3.3.193/16
|
||||
Address=10.3.3.194/16
|
||||
Address=10.3.3.195/16
|
||||
Address=10.3.3.196/16
|
||||
Address=10.3.3.197/16
|
||||
Address=10.3.3.198/16
|
||||
Address=10.3.3.199/16
|
||||
Address=10.3.3.200/16
|
||||
Address=10.3.3.201/16
|
||||
Address=10.3.3.202/16
|
||||
Address=10.3.3.203/16
|
||||
Address=10.3.3.204/16
|
||||
Address=10.3.3.205/16
|
||||
Address=10.3.3.206/16
|
||||
Address=10.3.3.207/16
|
||||
Address=10.3.3.208/16
|
||||
Address=10.3.3.209/16
|
||||
Address=10.3.3.210/16
|
||||
Address=10.3.3.211/16
|
||||
Address=10.3.3.212/16
|
||||
Address=10.3.3.213/16
|
||||
Address=10.3.3.214/16
|
||||
Address=10.3.3.215/16
|
||||
Address=10.3.3.216/16
|
||||
Address=10.3.3.217/16
|
||||
Address=10.3.3.218/16
|
||||
Address=10.3.3.219/16
|
||||
Address=10.3.3.220/16
|
||||
Address=10.3.3.221/16
|
||||
Address=10.3.3.222/16
|
||||
Address=10.3.3.223/16
|
||||
Address=10.3.3.224/16
|
||||
Address=10.3.3.225/16
|
||||
Address=10.3.3.226/16
|
||||
Address=10.3.3.227/16
|
||||
Address=10.3.3.228/16
|
||||
Address=10.3.3.229/16
|
||||
Address=10.3.3.230/16
|
||||
Address=10.3.3.231/16
|
||||
Address=10.3.3.232/16
|
||||
Address=10.3.3.233/16
|
||||
Address=10.3.3.234/16
|
||||
Address=10.3.3.235/16
|
||||
Address=10.3.3.236/16
|
||||
Address=10.3.3.237/16
|
||||
Address=10.3.3.238/16
|
||||
Address=10.3.3.239/16
|
||||
Address=10.3.3.240/16
|
||||
Address=10.3.3.241/16
|
||||
Address=10.3.3.242/16
|
||||
Address=10.3.3.243/16
|
||||
Address=10.3.3.244/16
|
||||
Address=10.3.3.245/16
|
||||
Address=10.3.3.246/16
|
||||
Address=10.3.3.247/16
|
||||
Address=10.3.3.248/16
|
||||
Address=10.3.3.249/16
|
||||
Address=10.3.3.250/16
|
||||
Address=10.3.3.251/16
|
||||
Address=10.3.3.252/16
|
||||
Address=10.3.3.253/16
|
||||
Address=10.3.3.254/16
|
||||
|
||||
@ -1767,6 +1767,10 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
||||
self.assertRegex(output, 'inet 10.1.2.4/16 brd 10.1.255.255 scope global secondary dummy98')
|
||||
self.assertRegex(output, 'inet 10.2.2.4/16 brd 10.2.255.255 scope global dummy98')
|
||||
|
||||
# test for ENOBUFS issue #17012
|
||||
for i in range(1,254):
|
||||
self.assertRegex(output, f'inet 10.3.3.{i}/16 brd 10.3.255.255')
|
||||
|
||||
# invalid sections
|
||||
self.assertNotRegex(output, '10.10.0.1/16')
|
||||
self.assertNotRegex(output, '10.10.0.2/16')
|
||||
@ -1792,6 +1796,14 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
||||
self.assertRegex(output, 'inet6 2001:db8:0:f103::20 peer 2001:db8:0:f103::10/128 scope global')
|
||||
self.assertRegex(output, 'inet6 fd[0-9a-f:]*1/64 scope global')
|
||||
|
||||
restart_networkd()
|
||||
self.wait_online(['dummy98:routable'])
|
||||
|
||||
# test for ENOBUFS issue #17012
|
||||
output = check_output('ip -4 address show dev dummy98')
|
||||
for i in range(1,254):
|
||||
self.assertRegex(output, f'inet 10.3.3.{i}/16 brd 10.3.255.255')
|
||||
|
||||
def test_address_preferred_lifetime_zero_ipv6(self):
|
||||
copy_unit_to_networkd_unit_path('25-address-preferred-lifetime-zero.network', '12-dummy.netdev')
|
||||
start_networkd(5)
|
||||
|
||||
@ -20,6 +20,7 @@ Wants=systemd-networkd.socket network.target
|
||||
|
||||
[Service]
|
||||
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW
|
||||
BusName=org.freedesktop.network1
|
||||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW
|
||||
DeviceAllow=char-* rw
|
||||
ExecStart=!!@rootlibexecdir@/systemd-networkd
|
||||
|
||||
@ -21,6 +21,7 @@ Wants=nss-lookup.target
|
||||
|
||||
[Service]
|
||||
AmbientCapabilities=CAP_SETPCAP CAP_NET_RAW CAP_NET_BIND_SERVICE
|
||||
BusName=org.freedesktop.resolve1
|
||||
CapabilityBoundingSet=CAP_SETPCAP CAP_NET_RAW CAP_NET_BIND_SERVICE
|
||||
ExecStart=!!@rootlibexecdir@/systemd-resolved
|
||||
LockPersonality=yes
|
||||
|
||||
@ -20,6 +20,7 @@ Wants=time-set.target time-sync.target
|
||||
|
||||
[Service]
|
||||
AmbientCapabilities=CAP_SYS_TIME
|
||||
BusName=org.freedesktop.timesync1
|
||||
CapabilityBoundingSet=CAP_SYS_TIME
|
||||
ExecStart=!!@rootlibexecdir@/systemd-timesyncd
|
||||
LockPersonality=yes
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user