Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic on DiscoverOffer #468

Closed
mgazza opened this issue Jun 16, 2022 · 1 comment
Closed

Panic on DiscoverOffer #468

mgazza opened this issue Jun 16, 2022 · 1 comment

Comments

@mgazza
Copy link

mgazza commented Jun 16, 2022

When calling discover offer the library panics with

panic: runtime error: index out of range [9] with length 4

goroutine 4 [running]:
github.com/insomniacslk/dhcp/dhcpv4/nclient4.ipv4.protocol(...)
	/Users/markgascoyne/go/pkg/mod/github.com/insomniacslk/[email protected]/dhcpv4/nclient4/ipv4.go:108
github.com/insomniacslk/dhcp/dhcpv4/nclient4.ipv4.transportProtocol(...)
	/Users/markgascoyne/go/pkg/mod/github.com/insomniacslk/[email protected]/dhcpv4/nclient4/ipv4.go:124
github.com/insomniacslk/dhcp/dhcpv4/nclient4.(*BroadcastRawUDPConn).ReadFrom(0x1400000e138, {0x14000180000, 0x5dc, 0x0?})
	/Users/markgascoyne/go/pkg/mod/github.com/insomniacslk/[email protected]/dhcpv4/nclient4/conn_unix.go:115 +0x368
github.com/insomniacslk/dhcp/dhcpv4/nclient4.(*Client).receiveLoop(0x14000116120)
	/Users/markgascoyne/go/pkg/mod/github.com/insomniacslk/[email protected]/dhcpv4/nclient4/client.go:262 +0x90
created by github.com/insomniacslk/dhcp/dhcpv4/nclient4.new
	/Users/markgascoyne/go/pkg/mod/github.com/insomniacslk/[email protected]/dhcpv4/nclient4/client.go:223 +0x3c0
package main

import (
	"context"
	"fmt"
	"github.com/insomniacslk/dhcp/dhcpv4/nclient4"
)

func main() {
	c, err := nclient4.New("en0")
	c.DiscoverOffer(context.TODO())
}
@pmazzini
Copy link
Collaborator

Fixed in #507

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants