Date: Sunday, July 13, 2014 @ 12:46:56
  Author: lcarlier
Revision: 115647

upgpkg: lib32-systemd 215-1

upstream update 215

Added:
  
lib32-systemd/trunk/0001-networkd-properly-track-addresses-when-first-added.patch
Modified:
  lib32-systemd/trunk/PKGBUILD

---------------------------------------------------------------+
 0001-networkd-properly-track-addresses-when-first-added.patch |  104 ++++++++++
 PKGBUILD                                                      |   14 +
 2 files changed, 115 insertions(+), 3 deletions(-)

Added: 0001-networkd-properly-track-addresses-when-first-added.patch
===================================================================
--- 0001-networkd-properly-track-addresses-when-first-added.patch               
                (rev 0)
+++ 0001-networkd-properly-track-addresses-when-first-added.patch       
2014-07-13 10:46:56 UTC (rev 115647)
@@ -0,0 +1,104 @@
+From 4958aee4977f325be19f0e1e4b424922c3cada5f Mon Sep 17 00:00:00 2001
+From: Tom Gundersen <t...@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
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2014-07-13 09:13:36 UTC (rev 115646)
+++ PKGBUILD    2014-07-13 10:46:56 UTC (rev 115647)
@@ -4,7 +4,7 @@
 
 pkgname=lib32-systemd
 _pkgbasename=systemd
-pkgver=214
+pkgver=215
 pkgrel=1
 pkgdesc="system and service manager (32-bit)"
 arch=('x86_64')
@@ -13,9 +13,17 @@
 depends=('lib32-glib2' 'lib32-libgcrypt' 'lib32-xz' 'systemd')
 makedepends=('lib32-gcc-libs' 'gcc-multilib' 'lib32-libcap' 'lib32-acl' 
              'intltool' 'gperf')
-source=("http://www.freedesktop.org/software/$_pkgbasename/$_pkgbasename-$pkgver.tar.xz";)
-md5sums=('eac4f9fc5bd18a0efc3fc20858baacf3')
+source=("http://www.freedesktop.org/software/$_pkgbasename/$_pkgbasename-$pkgver.tar.xz";
+       '0001-networkd-properly-track-addresses-when-first-added.patch')
+md5sums=('d2603e9fffd8b18d242543e36f2e7d31'
+        '2d237a277a12b3801c88d159d64a7413')
 
+prepare() {
+  cd "${srcdir}/systemd-${pkgver}"
+
+  patch -Np1 
<"$srcdir"/0001-networkd-properly-track-addresses-when-first-added.patch
+}
+
 build() {
   export CC="gcc -m32"
   export CXX="g++ -m32"

Reply via email to