mirror of
https://github.com/soypat/lneto.git
synced 2026-08-29 19:09:07 +00:00
dhcp subnet prefix fix
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
//go:build !tinygo
|
||||
|
||||
package internal
|
||||
|
||||
import "net"
|
||||
|
||||
func interfaceByName(name string) (*net.Interface, error) {
|
||||
return net.InterfaceByName(name)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
//go:build tinygo
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
)
|
||||
|
||||
func interfaceByName(name string) (*net.Interface, error) {
|
||||
return nil, errors.New("net.InterfaceByName not implemented on TinyGo")
|
||||
}
|
||||
+1
-2
@@ -7,7 +7,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/bits"
|
||||
"net"
|
||||
"net/netip"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -205,7 +204,7 @@ type Bridge struct {
|
||||
}
|
||||
|
||||
func NewBridge(name string) (*Bridge, error) {
|
||||
iface, err := net.InterfaceByName(name)
|
||||
iface, err := interfaceByName(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user