update deps; switch to goutils syslog.

This commit is contained in:
2023-05-05 07:13:46 +00:00
parent 7b7f1ea8a9
commit c475287fb1
17 changed files with 139 additions and 234 deletions

View File

@@ -8,8 +8,5 @@ go_library(
],
importpath = "git.wntrmute.dev/kyle/kdhcp/dhcp",
visibility = ["//visibility:public"],
deps = [
"//log",
"@com_github_davecgh_go_spew//spew",
],
deps = ["@dev_wntrmute_git_kyle_goutils//syslog"],
)

View File

@@ -4,11 +4,11 @@ import (
"bytes"
"encoding/binary"
"fmt"
"io"
"net"
"strings"
"git.wntrmute.dev/kyle/kdhcp/log"
"github.com/davecgh/go-spew/spew"
log "git.wntrmute.dev/kyle/goutils/syslog"
)
const (
@@ -127,7 +127,20 @@ func (req *BootRequest) Read(packet []byte) error {
}
req.FileName = string(bytes.Trim(tempBuf, "\x00"))
spew.Dump(*req)
for {
tag, err := buf.ReadByte()
if err != nil {
if err == io.EOF {
break
}
return err
}
err = ReadOption(req, tag, buf)
if err != nil {
return err
}
}
return nil
}