Skip to content

Commit

Permalink
fix dhcp h.isValid on qemu 6.0 (#26)
Browse files Browse the repository at this point in the history
* fix dhcp h.isValid on qemu 6.0

* add debugger for dlv
  • Loading branch information
icexin authored Jul 5, 2021
1 parent 5905260 commit ab05093
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "dlv-gdb",
"type": "go",
"request": "attach",
"mode": "local",
"cwd": "${workspaceFolder}",
"debugAdapter": "legacy",
"processId": 1234,
"backend": "gdbstub",
"dlvFlags": [
"${workspaceRoot}/kernel.elf",
],
},
{
"type": "gdb",
"request": "attach",
Expand All @@ -13,7 +26,8 @@
"remote": true,
"cwd": "${workspaceRoot}",
"valuesFormatting": "parseText",
"gdbpath": "gdb",
// "gdbpath": "gdb",
"gdbpath": "x86_64-elf-gdb",
},
]
}
2 changes: 1 addition & 1 deletion inet/dhcp/dhcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (h header) isValid() bool {
if h[1] != 0x01 || h[2] != 0x06 || h[3] != 0x00 {
return false
}
return bytes.Equal(h[236:240], magicCookie) && h[len(h)-1] == 0
return bytes.Equal(h[236:240], magicCookie)
}

func (h header) op() op { return op(h[0]) }
Expand Down

0 comments on commit ab05093

Please sign in to comment.