mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-08 01:24:57 +08:00
fix(link): listen integer divide by zero
This commit is contained in:
@@ -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)
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user