Skip to content

Commit

Permalink
fix(link): listen integer divide by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Aug 16, 2024
1 parent dfc9f1a commit 45c8945
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gold/link/me.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ func NewMe(cfg *MyConfig) (m Me) {
}
m.me = ip
m.subnet = *cidr
m.speedloop = cfg.SpeedLoop
if m.speedloop == 0 {
m.speedloop = 4096
}
m.conn, err = m.listen()
if err != nil {
panic(err)
Expand All @@ -110,10 +114,6 @@ func NewMe(cfg *MyConfig) (m Me) {
strconv.FormatUint(uint64(m.MTU()), 10), cfg.NICConfig.CIDRs...,
)
}
m.speedloop = cfg.SpeedLoop
if m.speedloop == 0 {
m.speedloop = 4096
}
m.mask = cfg.Mask
var buf [8]byte
binary.BigEndian.PutUint64(buf[:], m.mask)
Expand Down

0 comments on commit 45c8945

Please sign in to comment.