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

DHCP: Boot reply contains an unknown byte #8

Open
simar7 opened this issue Dec 11, 2016 · 0 comments
Open

DHCP: Boot reply contains an unknown byte #8

simar7 opened this issue Dec 11, 2016 · 0 comments

Comments

@simar7
Copy link
Owner

simar7 commented Dec 11, 2016

While testing DHCP boot replies with ServeDHCP(), the responses received contain an unknown byte in the header. See below:

Relevant Test:


func TestServeDHCP(t *testing.T) {
	dhcpServer := newDHCPServer()
	p := dhcp.NewPacket(dhcp.BootReply)

	expected := dhcp.ReplyPacket(p, dhcp.Offer, dhcpServer.ip,
		dhcp.IPAdd(dhcpServer.start, dhcpServer.freeLease()),
		dhcpServer.leaseDuration, dhcpServer.options.SelectOrderOrAll(nil))
	actual := dhcpServer.ServeDHCP(p, dhcp.Discover, nil)

	//TODO: Need a strong assertion
	assert.ObjectsAreEqual(actual, expected)
}

Output:

			Diff:
			--- Expected
			+++ Actual
			@@ -2,3 +2,3 @@
			  00000000  02 01 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
			- 00000010  ac 0a 00 27 00 00 00 00  00 00 00 00 00 00 00 00  |...'............|
			+ 00000010  ac 0a 00 31 00 00 00 00  00 00 00 00 00 00 00 00  |...1............|
			  00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant