Skip to content

Commit

Permalink
mac string fit with the DB field
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierskip committed Dec 30, 2020
1 parent 991c1fc commit 56c0740
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ var defaultTable string = "192.168.20.1/24"
func matchAddress(mac net.HardwareAddr) (net.IP, bool) {
var ip string
queryaddr := fmt.Sprintf("%s", mac)
// db field `mac` like 60-ab-67-f8-d5-6c
// db field `mac` like 60-AB-67-F8-D5-6C
queryaddr = strings.ReplaceAll(queryaddr, ":", "-")
queryaddr = strings.ToUpper(queryaddr)

// DB must exist!
//https://stackoverflow.com/questions/12518876/how-to-check-if-a-file-exists-in-go/12518877
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- DHCP MessageType 打印 ✅
- 日志合并一条后打印
- 设置多个DNS服务器 ✅
- MAC地址大小写与数据库不符
- MAC地址大小写与数据库不符
- 广播或者单播数据包
- 广播包同一网卡响应
- 数据库
Expand Down

0 comments on commit 56c0740

Please sign in to comment.