[systemd-commits] 5 commits - configure.ac man/systemd-resolved.service.xml src/libsystemd-network src/shared

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Sun Jun 22 09:26:24 PDT 2014


 configure.ac                          |   12 ++++++++++--
 man/systemd-resolved.service.xml      |   18 +++++++++---------
 src/libsystemd-network/dhcp-network.c |    4 ++++
 src/shared/socket-util.c              |    2 +-
 4 files changed, 24 insertions(+), 12 deletions(-)

New commits:
commit 68328ed63ce3a938679caf41db64e068234a0ca8
Author: Michal Sekletar <msekleta at redhat.com>
Date:   Thu Jun 19 18:59:37 2014 +0200

    dhcp-network: don't bother with IP fragments

diff --git a/src/libsystemd-network/dhcp-network.c b/src/libsystemd-network/dhcp-network.c
index 0e37bea..9d57917 100644
--- a/src/libsystemd-network/dhcp-network.c
+++ b/src/libsystemd-network/dhcp-network.c
@@ -41,6 +41,10 @@ int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link,
             BPF_STMT(BPF_LD + BPF_B + BPF_ABS, offsetof(DHCPPacket, ip.protocol)), /* A <- IP protocol */
             BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, IPPROTO_UDP, 1, 0),                /* IP protocol == UDP ? */
             BPF_STMT(BPF_RET + BPF_K, 0),                                          /* ignore */
+            BPF_STMT(BPF_LD + BPF_H + BPF_ABS, offsetof(DHCPPacket, ip.frag_off)), /* A <- Flags + Fragment offset */
+            BPF_STMT(BPF_ALU + BPF_AND + BPF_K, 0x1fff),                           /* A <- A & 0x1fff */
+            BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0, 1, 0),                          /* A == 0 ? */
+            BPF_STMT(BPF_RET + BPF_K, 0),                                          /* ignore */
             BPF_STMT(BPF_LD + BPF_H + BPF_ABS, offsetof(DHCPPacket, udp.dest)),    /* A <- UDP destination port */
             BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, DHCP_PORT_CLIENT, 1, 0),           /* UDP destination port == DHCP client port ? */
             BPF_STMT(BPF_RET + BPF_K, 0),                                          /* ignore */

commit 972bded03215d4602fdd2ed2d680350c8eacb056
Author: Michael Marineau <michael.marineau at coreos.com>
Date:   Fri Jun 20 13:46:04 2014 -0700

    build-sys: require elfutils >= 158
    
    The recently added stacktrace support in 8d4e028f uses functions added
    in elfutils 158. Check for one of the new functions to avoid attempting
    to build against older versions.

diff --git a/configure.ac b/configure.ac
index 18e934c..bb6018f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -672,7 +672,7 @@ AC_ARG_ENABLE([elfutils],
 if test "x${have_elfutils}" != xno ; then
         AC_CHECK_HEADERS(
                 [elfutils/libdwfl.h],
-                [have_elfutils=yes],
+                [],
                 [if test "x$have_elfutils" = xyes ; then
                         AC_MSG_ERROR([*** ELFUTILS headers not found.])
                 fi])
@@ -680,11 +680,19 @@ if test "x${have_elfutils}" != xno ; then
         AC_CHECK_LIB(
                 [dw],
                 [dwfl_begin],
-                [have_elfutils=yes],
+                [],
                 [if test "x$have_elfutils" = xyes ; then
                         AC_MSG_ERROR([*** ELFUTILS libs not found.])
                 fi])
 
+        AC_CHECK_LIB(
+                [dw],
+                [dwfl_core_file_attach],
+                [have_elfutils=yes],
+                [if test "x$have_elfutils" = xyes ; then
+                        AC_MSG_ERROR([*** ELFUTILS >= 158 is required.])
+                fi])
+
         if test "x$have_elfutils" = xyes ; then
                 ELFUTILS_LIBS="-lelf -ldw"
                 AC_DEFINE(HAVE_ELFUTILS, 1, [ELFUTILS available])

commit c305edb643130cbb2a9cc1414c216e21d227f32f
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jun 22 11:50:33 2014 -0400

    man: untabify systemd-resolved.service.xml

diff --git a/man/systemd-resolved.service.xml b/man/systemd-resolved.service.xml
index 517e08e..839f46a 100644
--- a/man/systemd-resolved.service.xml
+++ b/man/systemd-resolved.service.xml
@@ -58,24 +58,24 @@
 
                 <para><command>systemd-resolved</command> is a system
                 service that manages network name resolution. It does so by
-		generating <filename>/run/systemd/resolve/resolv.conf</filename>,
-		which may be symlinked from <filename>/etc/resolv.conf</filename>.
-		The contents is generated from the global settings in
+                generating <filename>/run/systemd/resolve/resolv.conf</filename>,
+                which may be symlinked from <filename>/etc/resolv.conf</filename>.
+                The contents is generated from the global settings in
                 <citerefentry><refentrytitle>resolved.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
-		the per-link static settings in <filename>.network</filename> files,
-		and the per-link dynamic settings received over DHCP. See
+                the per-link static settings in <filename>.network</filename> files,
+                and the per-link dynamic settings received over DHCP. See
                 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>
-		for more details.</para>
+                for more details.</para>
 
                 <para>Note that <filename>/run/systemd/resolve/resolv.conf</filename>
                 should not be used directly, but only through a symlink from
-		<filename>/etc/resolv.conf</filename>.</para>
+                <filename>/etc/resolv.conf</filename>.</para>
         </refsect1>
 
         <refsect1>
                 <title>See Also</title>
                 <para>
-			<citerefentry><refentrytitle>resolved.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+                        <citerefentry><refentrytitle>resolved.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
                         <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
                         <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>

commit 40ef48600f2c82c2eb41f6c71f35a8d172a530ad
Author: Jonathan Boulle <jonathanboulle at gmail.com>
Date:   Fri Jun 20 14:46:18 2014 -0700

    fix systemd-resolved reference in man page
    
    Guess this was missed in the copy-paste :-)

diff --git a/man/systemd-resolved.service.xml b/man/systemd-resolved.service.xml
index ed1f5a2..517e08e 100644
--- a/man/systemd-resolved.service.xml
+++ b/man/systemd-resolved.service.xml
@@ -56,7 +56,7 @@
         <refsect1>
                 <title>Description</title>
 
-                <para><command>systemd-networkd</command> is a system
+                <para><command>systemd-resolved</command> is a system
                 service that manages network name resolution. It does so by
 		generating <filename>/run/systemd/resolve/resolv.conf</filename>,
 		which may be symlinked from <filename>/etc/resolv.conf</filename>.

commit 57827c087c3d32920136842f242bf4183cbfcb35
Author: Marc-Antoine Perennou <Marc-Antoine at Perennou.com>
Date:   Sun Jun 22 19:36:03 2014 +0900

    fix in_addr_prefix_intersect for 32bits
    
    shifting from a non fixed number of bits >= to the size of the type
    leads to weird results, handle the special case of << 32 to fix it.
    
    This was causing a test failure from test-socket-util:
    Assertion 'in_addr_prefix_intersect(f, &ua, apl, &ub, bpl) == result' failed at
    /var/tmp/paludis/build/sys-apps-systemd-scm/work/systemd-scm/src/test/test-socket-util.c:147, function
    test_in_addr_prefix_intersect_one(). Aborting.
    
    Minimal reproducer:
    
    paludisbuild at Lou /tmp $ cat test.c
    static void test(unsigned m) {
            unsigned nm = 0xFFFFFFFFUL << (32-m);
            printf("%u: %x\n", m, nm);
    }
    
    int main (void) {
            test(1);
            test(0);
            return 0;
    }
    paludisbuild at Lou /tmp $ gcc -m32 -std=gnu99 test.c -o test32
    paludisbuild at Lou /tmp $ ./test32
    1: 80000000
    0: ffffffff
    paludisbuild at Lou /tmp $ gcc -std=gnu99 test.c -o test64
    paludisbuild at Lou /tmp $ ./test64
    1: 80000000
    0: 0

diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c
index f8c6795..6f49798 100644
--- a/src/shared/socket-util.c
+++ b/src/shared/socket-util.c
@@ -695,7 +695,7 @@ int in_addr_prefix_intersect(
                 uint32_t x, nm;
 
                 x = be32toh(a->in.s_addr ^ b->in.s_addr);
-                nm = 0xFFFFFFFFUL << (32 - m);
+                nm = (m == 0) ? 0 : 0xFFFFFFFFUL << (32 - m);
 
                 return (x & nm) == 0;
         }



More information about the systemd-commits mailing list