1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-24 08:02:33 +03:00

fix address bug

This commit is contained in:
Zack Scholl 2018-07-01 18:52:56 -07:00
parent 22220e54a7
commit 91c95a5a8c
2 changed files with 3 additions and 1 deletions

View File

@ -63,7 +63,7 @@ func (c *Croc) client(role int, channel string) (err error) {
log.Debugf("sender read error:", err)
return
}
// log.Debugf("recv: %s", cd.String2())
log.Debugf("recv: %s", cd.String2())
err = c.processState(cd)
if err != nil {
log.Warn(err)
@ -225,6 +225,7 @@ func (c *Croc) processState(cd channelData) (err error) {
c.cs.channel.Addresses = cd.Addresses
if c.cs.channel.Role == 0 && c.isLocal {
c.cs.channel.Addresses[0] = getLocalIP()
log.Debugf("local IP: %s", c.cs.channel.Addresses[0])
}
c.bothConnected = cd.Addresses[0] != "" && cd.Addresses[1] != ""

View File

@ -105,6 +105,7 @@ func (c *Croc) updateChannel(cd channelData) (err error) {
c.rs.channel[cd.Channel].Pake.Xᵥ = cd.Pake.Xᵥ
c.rs.channel[cd.Channel].Pake.Yᵤ = cd.Pake.Yᵤ
c.rs.channel[cd.Channel].Pake.Yᵥ = cd.Pake.Yᵥ
c.rs.channel[cd.Channel].Addresses = cd.Addresses
return
}