mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Add "IfTAPMode" configuration option to allow selecting TAP mode on supported platforms
This commit is contained in:
parent
869997e4c5
commit
e9bd98d213
6 changed files with 34 additions and 12 deletions
|
@ -205,14 +205,14 @@ func (c *Core) DEBUG_getAddr() *address {
|
|||
return address_addrForNodeID(&c.dht.nodeID)
|
||||
}
|
||||
|
||||
func (c *Core) DEBUG_startTun(ifname string) {
|
||||
c.DEBUG_startTunWithMTU(ifname, 1280)
|
||||
func (c *Core) DEBUG_startTun(ifname string, iftapmode bool) {
|
||||
c.DEBUG_startTunWithMTU(ifname, iftapmode, 1280)
|
||||
}
|
||||
|
||||
func (c *Core) DEBUG_startTunWithMTU(ifname string, mtu int) {
|
||||
func (c *Core) DEBUG_startTunWithMTU(ifname string, iftapmode bool, mtu int) {
|
||||
addr := c.DEBUG_getAddr()
|
||||
straddr := fmt.Sprintf("%s/%v", net.IP(addr[:]).String(), 8*len(address_prefix))
|
||||
err := c.tun.setup(ifname, straddr, mtu)
|
||||
err := c.tun.setup(ifname, iftapmode, straddr, mtu)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue