use_token: update only when addresses differ, and update serial.
parent
b3aa91fd07
commit
945e366097
|
@ -338,6 +338,9 @@ class DNSManager::Storage
|
||||||
zone = zone_must_exist! token.domain
|
zone = zone_must_exist! token.domain
|
||||||
rr = zone.rr_must_exist! token.rrid
|
rr = zone.rr_must_exist! token.rrid
|
||||||
|
|
||||||
|
# Same address, no need to change anything.
|
||||||
|
return Response::Success.new if rr.target == address
|
||||||
|
|
||||||
# TODO: validate target?
|
# TODO: validate target?
|
||||||
|
|
||||||
case rr
|
case rr
|
||||||
|
@ -349,7 +352,7 @@ class DNSManager::Storage
|
||||||
when Zone::AAAA
|
when Zone::AAAA
|
||||||
rr.target = address
|
rr.target = address
|
||||||
zone.update_rr rr
|
zone.update_rr rr
|
||||||
zones_by_domain.update_or_create zone.domain, zone
|
update_zone zone
|
||||||
Response::Success.new
|
Response::Success.new
|
||||||
else
|
else
|
||||||
Response::Error.new "use token on invalid entry (not A or AAAA)"
|
Response::Error.new "use token on invalid entry (not A or AAAA)"
|
||||||
|
|
Loading…
Reference in New Issue