[systemd-commits] 2 commits - Makefile.am src/network
Zbigniew Jędrzejewski-Szmek
zbyszek at kemper.freedesktop.org
Mon Feb 2 21:47:10 PST 2015
Makefile.am | 4 +++-
src/network/networkd-address.c | 4 ++++
src/network/test-network.c | 3 +--
3 files changed, 8 insertions(+), 3 deletions(-)
New commits:
commit 36c957959dc11ae7176c5ed07a03ca370014899b
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Mon Feb 2 22:59:22 2015 -0500
build-sys: distribute systemd-networkd.socket
diff --git a/Makefile.am b/Makefile.am
index fdadda7..2b980b4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5666,9 +5666,11 @@ tests += \
test-network \
test-network-tables
+dist_systemunit_DATA += \
+ units/systemd-networkd.socket
+
nodist_systemunit_DATA += \
units/systemd-networkd.service \
- units/systemd-networkd.socket \
units/systemd-networkd-wait-online.service
GENERAL_ALIASES += \
commit 6cb8e687f038424ef54b5c5c3c433be974fbe371
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Mon Feb 2 21:32:28 2015 -0500
network-address,test-network: avoid undefined behaviour
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index ce0e923..47033ac 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -592,6 +592,10 @@ bool address_equal(Address *a1, Address *a2) {
case AF_INET:
if (a1->prefixlen != a2->prefixlen)
return false;
+ else if (a1->prefixlen == 0)
+ /* make sure we don't try to shift by 32.
+ * See ISO/IEC 9899:TC3 § 6.5.7.3. */
+ return true;
else {
uint32_t b1, b2;
diff --git a/src/network/test-network.c b/src/network/test-network.c
index ea9f938..b4a7be0 100644
--- a/src/network/test-network.c
+++ b/src/network/test-network.c
@@ -158,10 +158,9 @@ static void test_address_equality(void) {
assert_se(address_equal(a1, a2));
assert_se(inet_pton(AF_INET, "192.168.3.9", &a1->in_addr.in));
- assert_se(!address_equal(a1, a2));
+ assert_se(address_equal(a1, a2));
assert_se(inet_pton(AF_INET, "192.168.3.9", &a2->in_addr.in));
assert_se(address_equal(a1, a2));
-
a1->prefixlen = 10;
assert_se(!address_equal(a1, a2));
a2->prefixlen = 10;
More information about the systemd-commits
mailing list