Skip to content

Commit

Permalink
Merge pull request #30 from Piasy/master
Browse files Browse the repository at this point in the history
fix #26
  • Loading branch information
ckt authored Jul 26, 2018
2 parents cf47f40 + 784235e commit be486d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions stun/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ func (c *Client) sendBindingReq(conn net.PacketConn, addr net.Addr, changeIP boo
attribute = newChangeReqAttribute(changeIP, changePort)
pkt.addAttribute(*attribute)
}
// length of fingerprint attribute must be included into crc,
// so we add it before calculating crc, then subtract it after calculating crc.
pkt.length += 8
attribute = newFingerprintAttribute(pkt)
pkt.length -= 8
pkt.addAttribute(*attribute)
// Send packet.
return c.send(pkt, conn, addr)
Expand Down

0 comments on commit be486d1

Please sign in to comment.