This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 3.x development tree".
The branch, master has been updated via ca468b64bb442c1556bd5ebbfe60f1ae606ca81d (commit) from bef6465a923f71647b2b0b9a06725035e05a03af (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit ca468b64bb442c1556bd5ebbfe60f1ae606ca81d Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Oct 23 16:31:15 2015 +0100
network: Fix build on 32 architectures
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
-----------------------------------------------------------------------
Summary of changes: network/network.nm | 21 ++-- ...tcalc-Allow-build-on-64-bit-architectures.patch | 127 +++++++++++++++++++++ network/systemd/network.service | 13 --- 3 files changed, 141 insertions(+), 20 deletions(-) create mode 100644 network/patches/0001-inetcalc-Allow-build-on-64-bit-architectures.patch delete mode 100644 network/systemd/network.service
Difference in files: diff --git a/network/network.nm b/network/network.nm index be3c641..7228a65 100644 --- a/network/network.nm +++ b/network/network.nm @@ -6,7 +6,7 @@ name = network epoch = 1 version = 007 -release = 1 +release = 1.1
maintainer = Michael Tremer michael.tremer@ipfire.org groups = Base Networking/Tools @@ -25,8 +25,15 @@ source_dl = http://source.ipfire.org/releases/network/
build requires + autoconf + automake docbook-xsl libxslt + systemd-devel + end + + prepare_cmds + [ -e "configure" ] || ./autogen.sh end
install_cmds @@ -63,23 +70,23 @@ packages end
configfiles - /etc/firewall /etc/network end
- # Enable network service, so it starts at the first boot. script postin systemctl daemon-reload >/dev/null 2>&1 || : - systemctl --no-reload enable network.service >/dev/null 2>&1 || : end
- script preun - systemctl --no-reload disable network.service >/dev/null 2>&1 || : - systemctl stop network.service >/dev/null 2>&1 || : + script postun + systemctl daemon-reload >/dev/null 2>&1 || : end
script postup systemctl daemon-reload >/dev/null 2>&1 || : end end + + package %{name}-debuginfo + template DEBUGINFO + end end diff --git a/network/patches/0001-inetcalc-Allow-build-on-64-bit-architectures.patch b/network/patches/0001-inetcalc-Allow-build-on-64-bit-architectures.patch new file mode 100644 index 0000000..fec5b2c --- /dev/null +++ b/network/patches/0001-inetcalc-Allow-build-on-64-bit-architectures.patch @@ -0,0 +1,127 @@ +From cf3fb03ccc299b1233fa1a3cc4ce66520c324e70 Mon Sep 17 00:00:00 2001 +From: Michael Tremer michael.tremer@ipfire.org +Date: Wed, 21 Oct 2015 18:42:06 +0200 +Subject: [PATCH] inetcalc: Allow build on 64 bit architectures + +inetcalc previously used a GCC extension that was only +available on 64 bit platforms. This patch changes the +code to use struct in6_addr instead of __uint128_t for +storing IP addresses. + +Signed-off-by: Michael Tremer michael.tremer@ipfire.org +--- + src/inetcalc.c | 47 +++++++++++++++++++++++++++++++++-------------- + 1 file changed, 33 insertions(+), 14 deletions(-) + +diff --git a/src/inetcalc.c b/src/inetcalc.c +index f821d6ed41a6..ba692542aba7 100644 +--- a/src/inetcalc.c ++++ b/src/inetcalc.c +@@ -30,17 +30,26 @@ + + typedef struct ip_address { + int family; +- __uint128_t addr; ++ struct in6_addr addr; + int prefix; + } ip_address_t; + +-static __uint128_t prefix_to_bitmask(int prefix) { +- __uint128_t bitmask = ~0; ++static struct in6_addr prefix_to_bitmask(int prefix) { ++ assert(prefix <= 128); + +- for (int i = 0; i < 128 - prefix; i++) +- bitmask >>= 1; ++ struct in6_addr bitmask; + +- return bitmask; ++ for (int i = 0; i < 16; i++) ++ bitmask.s6_addr[i] = 0; ++ ++ for (int i = prefix, j = 0; i > 0; i -= 8, j++) { ++ if (i >= 8) ++ bitmask.s6_addr[j] = 0xff; ++ else ++ bitmask.s6_addr[j] = 0xff << (8 - i); ++ } ++ ++ return bitmask; + } + + static int bitmask_to_prefix(uint32_t bits) { +@@ -171,7 +180,7 @@ static int ip_address_eq(const ip_address_t* a1, const ip_address_t* a2) { + if (a1->family != a2->family) + return 1; + +- if (a1->addr != a2->addr) ++ if (a1->addr.s6_addr != a2->addr.s6_addr) + return 1; + + if (a1->prefix != a2->prefix) +@@ -184,7 +193,7 @@ static int ip_address_gt(const ip_address_t* a1, const ip_address_t* a2) { + if (a1->family != a2->family || a1->prefix != a2->prefix) + return -1; + +- if (a1->addr > a2->addr) ++ if (a1->addr.s6_addr > a2->addr.s6_addr) + return 0; + + return 1; +@@ -193,7 +202,7 @@ static int ip_address_gt(const ip_address_t* a1, const ip_address_t* a2) { + static int ip_address_format_string(char* buffer, size_t size, const ip_address_t* ip) { + assert(ip->family == AF_INET || ip->family == AF_INET6); + +- const char* p = inet_ntop(ip->family, &ip->addr, buffer, size); ++ const char* p = inet_ntop(ip->family, &ip->addr.s6_addr, buffer, size); + if (!p) + return errno; + +@@ -218,21 +227,25 @@ static void ip_address_print(const ip_address_t* ip) { + static void ip_address_make_network(ip_address_t* net, const ip_address_t* ip) { + assert(ip->prefix >= 0); + +- __uint128_t mask = prefix_to_bitmask(ip->prefix); ++ struct in6_addr mask = prefix_to_bitmask(ip->prefix); + + net->family = ip->family; + net->prefix = ip->prefix; +- net->addr = ip->addr & mask; ++ ++ for (int i = 0; i < 16; i++) ++ net->addr.s6_addr[i] = ip->addr.s6_addr[i] & mask.s6_addr[i]; + } + + static void ip_address_make_broadcast(ip_address_t* broadcast, const ip_address_t* ip) { + assert(ip->family == AF_INET && ip->prefix >= 0); + +- __uint128_t mask = prefix_to_bitmask(ip->prefix); ++ struct in6_addr mask = prefix_to_bitmask(ip->prefix); + + broadcast->family = ip->family; + broadcast->prefix = ip->prefix; +- broadcast->addr = ip->addr | ~mask; ++ ++ for (int i = 0; i < 16; i++) ++ broadcast->addr.s6_addr[i] = ip->addr.s6_addr[i] | ~mask.s6_addr[i]; + } + + static int action_check(const int family, const char* address) { +@@ -342,7 +355,13 @@ static int action_prefix(const int family, const char* addr1, const char* addr2) + if (r) + return r; + +- uint32_t mask = ntohl(network.addr ^ broadcast.addr); ++ struct in6_addr netmask; ++ for (int i = 0; i < 16; i++) ++ netmask.s6_addr[i] = network.addr.s6_addr[i] ^ broadcast.addr.s6_addr[i]; ++ ++ uint32_t mask = netmask.s6_addr[0] << 24 | netmask.s6_addr[1] << 16 | ++ netmask.s6_addr[2] << 8 | netmask.s6_addr[3]; ++ + int prefix = bitmask_to_prefix(~mask); + if (prefix < 0) + return 1; +-- +2.4.3 + diff --git a/network/systemd/network.service b/network/systemd/network.service deleted file mode 100644 index 4509a35..0000000 --- a/network/systemd/network.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Network Connectivity -Before=network.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStartPre=/sbin/network init -ExecStart=/sbin/network start -ExecStop=/sbin/network stop - -[Install] -WantedBy=multi-user.target
hooks/post-receive -- IPFire 3.x development tree