mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
dns: log error when adding an invalid record
This commit is contained in:
1 parent
813c5fef94
commit
cb698713ee
8 files changed
+34
-35
No files matched your search
@@ -66,10 +66,9 @@ func (*dpcpd) Run(args ...string) {
|
||||
|
||||
// static ips
|
||||
for _, host := range args[4:] {
|
||||
pair := strings.Split(host, "=")
|
||||
if len(pair) == 2 {
|
||||
if mac, err := net.ParseMAC(pair[0]); err == nil {
|
||||
if ip, err := netip.ParseAddr(pair[1]); err == nil {
|
||||
if mac, ip, ok := strings.Cut(host, "="); ok {
|
||||
if mac, err := net.ParseMAC(mac); err == nil {
|
||||
if ip, err := netip.ParseAddr(ip); err == nil {
|
||||
pool.LeaseStaticIP(mac, ip)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user