mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Add API functions for manipulating maximum session MTU, fix TUN/TAP to use that
This commit is contained in:
parent
789307d52b
commit
e90be6f569
3 changed files with 24 additions and 3 deletions
|
@ -363,6 +363,22 @@ func (c *Core) SetNodeInfo(nodeinfo interface{}, nodeinfoprivacy bool) {
|
|||
c.router.nodeinfo.setNodeInfo(nodeinfo, nodeinfoprivacy)
|
||||
}
|
||||
|
||||
// GetMaximumSessionMTU returns the maximum allowed session MTU size.
|
||||
func (c *Core) GetMaximumSessionMTU(mtu uint16) uint16 {
|
||||
return c.router.sessions.myMaximumMTU
|
||||
}
|
||||
|
||||
// SetMaximumSessionMTU sets the maximum allowed session MTU size. The return
|
||||
// value contains the actual set value, since Yggdrasil will not accept MTUs
|
||||
// below 1280 bytes. The default value is 65535 bytes.
|
||||
func (c *Core) SetMaximumSessionMTU(mtu uint16) uint16 {
|
||||
if mtu < 1280 {
|
||||
mtu = 1280
|
||||
}
|
||||
c.router.sessions.myMaximumMTU = mtu
|
||||
return mtu
|
||||
}
|
||||
|
||||
// GetNodeInfo requests nodeinfo from a remote node, as specified by the public
|
||||
// key and coordinates specified. The third parameter specifies whether a cached
|
||||
// result is acceptable - this results in less traffic being generated than is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue