core/systemd to 216-1

This commit is contained in:
Kevin Mihelich 2014-08-27 06:22:24 +00:00
parent 0a924632b0
commit 0a79853d3d
3 changed files with 19 additions and 126 deletions

View file

@ -1,104 +0,0 @@
From 4958aee4977f325be19f0e1e4b424922c3cada5f Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Thu, 3 Jul 2014 22:47:51 +0200
Subject: [PATCH] networkd: properly track addresses when first added
When doing a NEWADDR, the reply we get back is the NEWADDR itself, rather
than just an empty ack (unlike how NEWLINK works). For this reason, the
process that did the NEWADDR does not get the broadcast message.
We were only listening for broadcast messages, and hence not tracking the
addresses we added ourselves. This went unnoticed as the kernel will usually
send NEWADDR messages from time to time anyway, so things would mostly work,
but in the worst case we would not notice that a routable address was available
and consider ourselves offline.
---
src/network/networkd-link.c | 54 +++++++++++++++++++++++++--------------------
1 file changed, 30 insertions(+), 24 deletions(-)
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 961c1ab..6257372 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -599,10 +599,35 @@ static int route_drop_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata)
return 0;
}
+static int link_get_address_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
+ _cleanup_link_unref_ Link *link = userdata;
+ int r;
+
+ assert(rtnl);
+ assert(m);
+ assert(link);
+ assert(link->manager);
+
+ for (; m; m = sd_rtnl_message_next(m)) {
+ r = sd_rtnl_message_get_errno(m);
+ if (r < 0) {
+ log_debug_link(link, "getting address failed: %s", strerror(-r));
+ continue;
+ }
+
+ r = link_rtnl_process_address(rtnl, m, link->manager);
+ if (r < 0)
+ log_warning_link(link, "could not process address: %s", strerror(-r));
+ }
+
+ return 1;
+}
+
static int address_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
_cleanup_link_unref_ Link *link = userdata;
int r;
+ assert(rtnl);
assert(m);
assert(link);
assert(link->ifname);
@@ -623,6 +648,11 @@ static int address_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
link->ifname, strerror(-r),
"ERRNO=%d", -r,
NULL);
+ if (r >= 0) {
+ /* calling handler directly so take a ref */
+ link_ref(link);
+ link_get_address_handler(rtnl, m, link);
+ }
if (link->addr_messages == 0) {
log_debug_link(link, "addresses set");
@@ -2233,30 +2263,6 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use
return 1;
}
-static int link_get_address_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
- _cleanup_link_unref_ Link *link = userdata;
- int r;
-
- assert(rtnl);
- assert(m);
- assert(link);
- assert(link->manager);
-
- for (; m; m = sd_rtnl_message_next(m)) {
- r = sd_rtnl_message_get_errno(m);
- if (r < 0) {
- log_debug_link(link, "getting address failed: %s", strerror(-r));
- continue;
- }
-
- r = link_rtnl_process_address(rtnl, m, link->manager);
- if (r < 0)
- log_warning_link(link, "could not process address: %s", strerror(-r));
- }
-
- return 1;
-}
-
int link_add(Manager *m, sd_rtnl_message *message, Link **ret) {
Link *link;
_cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
--
2.0.1

View file

@ -2,12 +2,12 @@
# Maintainer: Tom Gundersen <teg@jklm.no>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - disable optimization, currently breaks timesyncd over distcc
# - disable optimization, currently breaks many things
pkgbase=systemd
pkgname=('systemd' 'libsystemd' 'systemd-sysvcompat')
pkgver=215
pkgrel=4.1
pkgver=216
pkgrel=1
arch=('i686' 'x86_64')
url="http://www.freedesktop.org/wiki/Software/systemd"
makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'gobject-introspection' 'gperf'
@ -18,19 +18,11 @@ options=('strip' 'debug')
source=("http://www.freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.xz"
'initcpio-hook-udev'
'initcpio-install-systemd'
'initcpio-install-udev'
'0001-networkd-properly-track-addresses-when-first-added.patch')
md5sums=('d2603e9fffd8b18d242543e36f2e7d31'
'initcpio-install-udev')
md5sums=('04fda588a04f549da0f397dce3ae6a39'
'29245f7a240bfba66e2b1783b63b6b40'
'66cca7318e13eaf37c5b7db2efa69846'
'bde43090d4ac0ef048e3eaee8202a407'
'2d237a277a12b3801c88d159d64a7413')
prepare() {
cd "$pkgname-$pkgver"
patch -Np1 <"$srcdir"/0001-networkd-properly-track-addresses-when-first-added.patch
}
'bde43090d4ac0ef048e3eaee8202a407')
build() {
cd "$pkgname-$pkgver"
@ -67,7 +59,8 @@ package_systemd() {
'cryptsetup: required for encrypted block devices'
'libmicrohttpd: remote journald capabilities'
'quota-tools: kernel-level quota management'
'systemd-sysvcompat: symlink package to provide sysvinit binaries')
'systemd-sysvcompat: symlink package to provide sysvinit binaries'
'polkit: allow administration as unprivileged user')
backup=(etc/dbus-1/system.d/org.freedesktop.systemd1.conf
etc/dbus-1/system.d/org.freedesktop.hostname1.conf
etc/dbus-1/system.d/org.freedesktop.login1.conf
@ -92,14 +85,11 @@ package_systemd() {
rm "$pkgdir/etc/systemd/system/getty.target.wants/getty@tty1.service" \
"$pkgdir/etc/systemd/system/multi-user.target.wants/systemd-networkd.service" \
"$pkgdir/etc/systemd/system/multi-user.target.wants/systemd-resolved.service" \
"$pkgdir/etc/systemd/system/multi-user.target.wants/systemd-timesyncd.service" \
"$pkgdir/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service" \
"$pkgdir/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service"
rmdir "$pkgdir/etc/systemd/system/getty.target.wants" \
"$pkgdir/etc/systemd/system/network-online.target.wants"
# remove the coredump rule until minidumps are a thing.
rm "$pkgdir/usr/lib/sysctl.d/50-coredump.conf"
# get rid of RPM macros
rm -r "$pkgdir/usr/lib/rpm"

View file

@ -1,7 +1,7 @@
#!/bin/bash
sd_booted() {
[[ -d run/systemd/system ]]
[[ -d run/systemd/system && ! -L run/systemd/system ]]
}
add_privs() {
@ -36,8 +36,8 @@ _dir_empty() {
}
post_common() {
systemd-machine-id-setup
systemd-sysusers
systemd-tmpfiles --create
udevadm hwdb --update
journalctl --update-catalog
}
@ -142,7 +142,14 @@ _215_2_changes() {
systemd-tmpfiles --create etc.conf
}
_216_1_changes() {
echo ':: Coredumps are handled by systemd by default. Collection behavior can be'
echo ' tuned in /etc/systemd/coredump.conf.'
}
post_install() {
systemd-firstboot --setup-machine-id
post_common "$@"
add_journal_acls