summaryrefslogtreecommitdiffhomepage
path: root/tunnel/tools/libwg-go/dhcp.go
diff options
context:
space:
mode:
Diffstat (limited to 'tunnel/tools/libwg-go/dhcp.go')
-rw-r--r--tunnel/tools/libwg-go/dhcp.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/tunnel/tools/libwg-go/dhcp.go b/tunnel/tools/libwg-go/dhcp.go
index 83a8c865..f6f25739 100644
--- a/tunnel/tools/libwg-go/dhcp.go
+++ b/tunnel/tools/libwg-go/dhcp.go
@@ -85,7 +85,7 @@ func isRelayMessageType(t dhcpv6.MessageType, tt ...dhcpv6.MessageType) nclient6
// func New() *dhcp {
// }
-func RunDhcp(ctx context.Context) ([]*gen.Lease, error) {
+func RunDhcp(ctx context.Context, laddr, raddr netip.Addr) ([]*gen.Lease, error) {
d := &dhcp{}
d.linkAddr = net.ParseIP("fe80::101")
@@ -95,25 +95,17 @@ func RunDhcp(ctx context.Context) ([]*gen.Lease, error) {
d.fqdn = hostName + ".m7n.se"
d.hwAddr = []byte{41, 42, 43, 44, 45, 46}
- laddr, err := netip.ParseAddr("fd1c:a56b:a0d7:1260::101")
- if err != nil {
- return nil, err
- }
src := net.UDPAddr{IP: laddr.AsSlice(),
Port: 0, // Use non-restrict UDP source port
}
- raddr, err := netip.ParseAddr("fd1c:a56b:a0d7:1260::1")
- if err != nil {
- return nil, err
- }
d.serverAddr = net.UDPAddr{IP: raddr.AsSlice(),
Port: 547,
}
- err = d.Start(&src)
+ err := d.Start(&src)
if err != nil {
return nil, err
}