Further updates, notify sessions about updated MTU from API call

This commit is contained in:
Neil Alexander 2019-11-21 09:54:36 +00:00
parent d1c445dc41
commit 7c18c6806d
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
3 changed files with 22 additions and 13 deletions

View file

@ -55,10 +55,6 @@ type sessionInfo struct {
callbacks []chan func() // Finished work from crypto workers
}
func (sinfo *sessionInfo) reconfigure() {
// This is where reconfiguration would go, if we had anything to do
}
// Represents a session ping/pong packet, andincludes information like public keys, a session handle, coords, a timestamp to prevent replays, and the tun/tap MTU.
type sessionPing struct {
SendPermPub crypto.BoxPubKey // Sender's permanent key
@ -138,9 +134,12 @@ func (ss *sessions) init(r *router) {
}
func (ss *sessions) reconfigure() {
for _, session := range ss.sinfos {
session.reconfigure()
}
ss.router.Act(nil, func() {
for _, session := range ss.sinfos {
session.myMTU = ss.myMaximumMTU
session.ping(ss.router)
}
})
}
// Determines whether the session with a given publickey is allowed based on