Add assertion to check that named object has correct type.

Obtained from:	Yandex LLC
MFC after:	1 week
This commit is contained in:
Andrey V. Elsukov 2018-12-04 15:12:28 +00:00
parent 270adb2182
commit 0df76496a6

View File

@ -708,6 +708,8 @@ dyn_destroy(struct ip_fw_chain *ch, struct named_object *no)
IPFW_UH_WLOCK_ASSERT(ch);
KASSERT(no->etlv == IPFW_TLV_STATE_NAME,
("%s: wrong object type %u", __func__, no->etlv));
KASSERT(no->refcnt == 1,
("Destroying object '%s' (type %u, idx %u) with refcnt %u",
no->name, no->etlv, no->kidx, no->refcnt));