]> git.ipfire.org Git - thirdparty/bind9.git/commit
Remove rpz->db_registered
authorMatthijs Mekking <matthijs@isc.org>
Fri, 8 Feb 2019 15:20:47 +0000 (16:20 +0100)
committerMatthijs Mekking <github@pletterpet.nl>
Fri, 22 Feb 2019 14:23:59 +0000 (15:23 +0100)
commit6594f7acb2c48819f49e70871df588b7a82ae0a8
tree33278099bc7f91bcf57ddb5d7b348ca13ae3ef5d
parenta4cd74e71af9da379ed891b22fb20e002f6876b9
Remove rpz->db_registered

As pointed out in !813 db_registered is sort of redundant.  It is
set to `true` only in `dns_zone_rpz_enable_db()` right before the
`dns_rpz_dbupdate_callback()` callback is registered.  It is only
required in that callback and it is the only place that the callback
is registered.  Therefore there is no path that that `REQUIRE` can
fail.

The `db_registered` variable is only set to `false` in
`dns_rpz_new_zone`, so it is not like the variable is unset again
later.

The only other place where `db_registered` is checked is in
`rpz_detach()`.  If `true`, it will call
`dns_db_updatenotify_unregister()`.  However if that happens, the
`db_registered` is not set back to `false` thus this implies that
this may happen multiple times.  If called a second time, most
likely the unregister function will return `ISC_R_NOTFOUND`, but
the return value is not checked anyway.  So it can do without the
`db_registered` check.
lib/dns/include/dns/rpz.h
lib/dns/rpz.c
lib/dns/zone.c