1
0
mirror of https://github.com/systemd/systemd synced 2026-04-11 01:24:50 +02:00

Compare commits

..

No commits in common. "58f62d7079a3d77b859a25d585dd492531bda0a1" and "05c1b1c95edb3b2d051b5b60e5a0519e23b221ab" have entirely different histories.

3 changed files with 16 additions and 19 deletions

7
NEWS
View File

@ -335,15 +335,14 @@ CHANGES WITH 250 in spe:
UseMTU= setting that may be used to control whether to apply the UseMTU= setting that may be used to control whether to apply the
announced MTU settings to the local interface. announced MTU settings to the local interface.
* systemd-networkd now ships with new default .network files: * systemd-networkd now ships with another default .network files:
80-container-vb.network which matches host-side network bridge device 80-container-vb.network which matches host-side network bridge device
created by systemd-nspawn's --network-bridge or --network-zone created by systemd-nspawn's --network-bridge or --network-zone
switch, and 80-6rd-tunnel.network which matches automatically created switch, and 80-6rd-tunnel.network which matches automatically created
sit tunnel with 6rd prefix when the DHCP 6RD option is received. sit tunnel with 6rd prefix when the DHCP 6RD option is received.
* systemd-networkd and systemd-udevd now support IP over InfiniBand * systemd-networkd and systemd-udevd now support IP over InfiniBand
interfaces. The Kind= setting in .netdev file accepts "ipoib". And interfaces.
systemd.netdev files gained the [IPoIB] section.
* systemd-networkd's handling of Endpoint= resolution for WireGuard * systemd-networkd's handling of Endpoint= resolution for WireGuard
interfaces has been improved. interfaces has been improved.
@ -354,7 +353,7 @@ CHANGES WITH 250 in spe:
* systemd-networkd will now once again automatically generate persistent * systemd-networkd will now once again automatically generate persistent
MAC addresses for batadv and bridge interfaces. Users can disable this MAC addresses for batadv and bridge interfaces. Users can disable this
by using MACAddress=none in .netdev files. by using MACAddress=none.
* .link files gained a new WakeOnLanPassword= setting in the [Link] * .link files gained a new WakeOnLanPassword= setting in the [Link]
section that allows to specify a WoL "SecureOn" password on hardware section that allows to specify a WoL "SecureOn" password on hardware

View File

@ -15,9 +15,6 @@
#include "stat-util.h" #include "stat-util.h"
#include "sync-util.h" #include "sync-util.h"
#define PAYLOAD_BUFFER_SIZE (16U * 1024U)
#define MINIMUM_HOLE_SIZE (1U * 1024U * 1024U / 2U)
static int journald_file_truncate(JournalFile *f) { static int journald_file_truncate(JournalFile *f) {
uint64_t p; uint64_t p;
int r; int r;
@ -69,9 +66,6 @@ static int journald_file_entry_array_punch_hole(JournalFile *f, uint64_t p, uint
(journal_file_entry_array_n_items(&o) - n_unused) * sizeof(le64_t); (journal_file_entry_array_n_items(&o) - n_unused) * sizeof(le64_t);
sz = p + le64toh(o.object.size) - offset; sz = p + le64toh(o.object.size) - offset;
if (sz < MINIMUM_HOLE_SIZE)
return 0;
if (fallocate(f->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, offset, sz) < 0) if (fallocate(f->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, offset, sz) < 0)
return log_debug_errno(errno, "Failed to punch hole in entry array of %s: %m", f->path); return log_debug_errno(errno, "Failed to punch hole in entry array of %s: %m", f->path);
@ -79,9 +73,9 @@ static int journald_file_entry_array_punch_hole(JournalFile *f, uint64_t p, uint
} }
static int journald_file_punch_holes(JournalFile *f) { static int journald_file_punch_holes(JournalFile *f) {
HashItem items[PAYLOAD_BUFFER_SIZE / sizeof(HashItem)]; HashItem items[4096 / sizeof(HashItem)];
uint64_t p, sz; uint64_t p, sz;
ssize_t n; size_t to_read;
int r; int r;
r = journald_file_entry_array_punch_hole( r = journald_file_entry_array_punch_hole(
@ -91,13 +85,16 @@ static int journald_file_punch_holes(JournalFile *f) {
p = le64toh(f->header->data_hash_table_offset); p = le64toh(f->header->data_hash_table_offset);
sz = le64toh(f->header->data_hash_table_size); sz = le64toh(f->header->data_hash_table_size);
to_read = MIN((size_t) f->last_stat.st_blksize, sizeof(items));
for (uint64_t i = p; i < p + sz; i += n) { for (uint64_t i = p; i < p + sz; i += sizeof(items)) {
n = pread(f->fd, items, MIN(sizeof(items), p + sz - i), i); ssize_t n_read;
if (n < 0)
return n;
for (size_t j = 0; j < (size_t) n / sizeof(HashItem); j++) { n_read = pread(f->fd, items, MIN(to_read, p + sz - i), i);
if (n_read < 0)
return n_read;
for (size_t j = 0; j < (size_t) n_read / sizeof(HashItem); j++) {
Object o; Object o;
for (uint64_t q = le64toh(items[j].head_hash_offset); q != 0; for (uint64_t q = le64toh(items[j].head_hash_offset); q != 0;

View File

@ -854,8 +854,9 @@ static bool route_by_kernel(const Route *route) {
if (route->protocol == RTPROT_KERNEL) if (route->protocol == RTPROT_KERNEL)
return true; return true;
/* The kernels older than a826b04303a40d52439aa141035fca5654ccaccd (v5.11) create the IPv6 /* Do not touch multicast route added by kernel. See issue #6088.
* multicast with RTPROT_BOOT. Do not touch it. */ * TODO: Why the kernel adds this route with protocol RTPROT_BOOT?
* https://tools.ietf.org/html/rfc4862#section-5.4 may explain why. */
if (route->protocol == RTPROT_BOOT && if (route->protocol == RTPROT_BOOT &&
route->family == AF_INET6 && route->family == AF_INET6 &&
route->dst_prefixlen == 8 && route->dst_prefixlen == 8 &&