diff --git a/flannel.spec b/flannel.spec index e70eb95..9110601 100644 --- a/flannel.spec +++ b/flannel.spec @@ -43,7 +43,7 @@ Name: flannel Version: 0.6.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Etcd address management agent for overlay networks License: ASL 2.0 URL: https://%{provider_prefix} @@ -56,8 +56,9 @@ Source4: flannel-tmpfiles.conf Patch0: change-4001-to-2379-in-help-and-README.patch Patch1: change-coreos.com-network-to-atomic.io-network-in-he.patch +Patch2: patch-ip-pkg-on-ppc64le.patch -ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le +ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le s390x BuildRequires: golang >= 1.2.7 %if ! 0%{?with_bundled} @@ -189,6 +190,9 @@ providing packages with %{import_path} prefix. %setup -q -n %{repo}-%{commit} %patch0 -p1 %patch1 -p1 +%ifarch s390x +%patch2 -p1 +%endif find . -name "*.go" \ -print |\ @@ -309,6 +313,10 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath} %endif %changelog +* Tue Jan 03 2017 Jan Chaloupka - 0.6.2-2 +- Patch pkg/ip to build and run on s390x + resolves: #1348906 + * Tue Dec 13 2016 Jan Chaloupka - 0.6.2-1 - Update to 0.6.2 resolves: #1396472 diff --git a/patch-ip-pkg-on-ppc64le.patch b/patch-ip-pkg-on-ppc64le.patch new file mode 100644 index 0000000..a0e2e1f --- /dev/null +++ b/patch-ip-pkg-on-ppc64le.patch @@ -0,0 +1,75 @@ +From cf05c8357088a46679a8c6fa00be81917654d336 Mon Sep 17 00:00:00 2001 +From: salamaniibm +Date: Tue, 15 Nov 2016 04:17:54 +0000 +Subject: [PATCH 1/2] During test case execution, we came across all test + case failures due to invalid IP.s generation for s390x system. On checking + git issues , we came across the link + https://github.com/coreos/flannel/issues/526, which logs similar issue for + bigEndiane during IP.s generation. On analysis we came across + littleEndian check, where code is manipulating IP.s for bigEndianess, which + is unnecessary because changes are required only at bit-level not for IP. We + are removing the littleEndian check where the IP address are involved. + For example subnetSize := ip.IP4(1 << (32 - cfg.SubnetLen)), assume + cfg.SubnetLen=24 (by default) then, value of subnetSize should be same + regardless of endianess, which is achieved after endiness check is removed. + +--- + pkg/ip/ipnet.go | 27 ++++++--------------------- + 1 file changed, 6 insertions(+), 21 deletions(-) + +diff --git a/pkg/ip/ipnet.go b/pkg/ip/ipnet.go +index c8e6206..a3fa827 100644 +--- a/pkg/ip/ipnet.go ++++ b/pkg/ip/ipnet.go +@@ -24,17 +24,10 @@ import ( + type IP4 uint32 + + func FromBytes(ip []byte) IP4 { +- if NativelyLittle() { +- return IP4(uint32(ip[3]) | +- (uint32(ip[2]) << 8) | +- (uint32(ip[1]) << 16) | +- (uint32(ip[0]) << 24)) +- } else { +- return IP4(uint32(ip[0]) | +- (uint32(ip[1]) << 8) | +- (uint32(ip[2]) << 16) | +- (uint32(ip[3]) << 24)) +- } ++ return IP4(uint32(ip[3]) | ++ (uint32(ip[2]) << 8) | ++ (uint32(ip[1]) << 16) | ++ (uint32(ip[0]) << 24)) + } + + func FromIP(ip net.IP) IP4 { +@@ -58,11 +51,7 @@ func MustParseIP4(s string) IP4 { + } + + func (ip IP4) Octets() (a, b, c, d byte) { +- if NativelyLittle() { + a, b, c, d = byte(ip>>24), byte(ip>>16), byte(ip>>8), byte(ip) +- } else { +- a, b, c, d = byte(ip), byte(ip>>8), byte(ip>>16), byte(ip>>24) +- } + return + } + +@@ -71,12 +60,8 @@ func (ip IP4) ToIP() net.IP { + } + + func (ip IP4) NetworkOrder() uint32 { +- if NativelyLittle() { +- a, b, c, d := byte(ip>>24), byte(ip>>16), byte(ip>>8), byte(ip) +- return uint32(a) | (uint32(b) << 8) | (uint32(c) << 16) | (uint32(d) << 24) +- } else { +- return uint32(ip) +- } ++ a, b, c, d := byte(ip>>24), byte(ip>>16), byte(ip>>8), byte(ip) ++ return uint32(a) | (uint32(b) << 8) | (uint32(c) << 16) | (uint32(d) << 24) + } + + func (ip IP4) String() string { +-- +2.7.4 +