Merge ~morphis/snappy-hwe-snaps/+git/wifi-ap:fix-int-overflow into ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:master

Proposed by Simon Fels
Status: Merged
Approved by: Simon Fels
Approved revision: 25219d04aa9481222872432a1829d589168e7e8a
Merged at revision: 2f9a2a00d612fcac1015681e6e3497d512c4dee6
Proposed branch: ~morphis/snappy-hwe-snaps/+git/wifi-ap:fix-int-overflow
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:master
Diff against target: 24 lines (+4/-2)
1 file modified
cmd/client/cmd_wizard.go (+4/-2)
Reviewer Review Type Date Requested Status
Simon Fels Approve
Konrad Zapałowicz (community) code Approve
System Enablement Bot continuous-integration Needs Fixing
Review via email: mp+314024@code.launchpad.net

Description of the change

Fix compilation error on armhf and i386 for too big max int value

See https://launchpadlibrarian.net/301069373/buildlog_snap_ubuntu_xenial_armhf_wifi-ap-daily_BUILDING.txt.gz for example.

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Konrad Zapałowicz (kzapalowicz) wrote :

lgt

review: Approve (code)
Revision history for this message
Simon Fels (morphis) wrote :

Merging on my own until Matteo is back.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/cmd/client/cmd_wizard.go b/cmd/client/cmd_wizard.go
2index 446a56c..a8b9bb2 100644
3--- a/cmd/client/cmd_wizard.go
4+++ b/cmd/client/cmd_wizard.go
5@@ -21,7 +21,6 @@ import (
6 "encoding/json"
7 "fmt"
8 "log"
9- "math"
10 "net"
11 "net/http"
12 "os"
13@@ -300,7 +299,10 @@ var allSteps = [...]wizardStep{
14 defer procNetRoute.Close()
15
16 var iface string
17- minMetric := math.MaxUint32
18+ // Using something like math.MaxUint32 causes an overflow on
19+ // some architectures so lets use just a high enough value
20+ // for typical systems here.
21+ minMetric := 100000
22
23 scanner := bufio.NewScanner(procNetRoute)
24 // Skip the first line with table header

Subscribers

People subscribed via source and target branches

to all changes: