net/bosh-bootloader: Fix build on 32-bit platforms

The build was failing with the following error:

    bosh/ip.go:55:16: constant 4278190080 overflows int

Sponsored by:	Pivotal
This commit is contained in:
Jean-Sébastien Pédron 2018-01-30 10:54:48 +00:00
parent 8b98134bde
commit b87d705335
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=460380
2 changed files with 21 additions and 0 deletions

View file

@ -2,6 +2,7 @@
PORTNAME= bosh-bootloader
PORTVERSION= 6.0.0
PORTREVISION= 1
CATEGORIES= net sysutils
MAINTAINER= dumbbell@FreeBSD.org

View file

@ -0,0 +1,20 @@
This patch fixes the build on 32-bit platforms. It was failing with the
following error:
bosh/ip.go:55:16: constant 4278190080 overflows int
--- bosh/ip.go.orig 2018-01-20 21:01:35 UTC
+++ bosh/ip.go
@@ -52,9 +52,9 @@ func (i IP) Subtract(offset int) IP {
}
func (i IP) String() string {
- first := i.ip & 0xff000000 >> 24
- second := i.ip & 0xff0000 >> 16
- third := i.ip & 0xff00 >> 8
- fourth := i.ip & 0xff
+ first := uint32(i.ip) & 0xff000000 >> 24
+ second := uint32(i.ip) & 0xff0000 >> 16
+ third := uint32(i.ip) & 0xff00 >> 8
+ fourth := uint32(i.ip) & 0xff
return fmt.Sprintf("%v.%v.%v.%v", first, second, third, fourth)
}