diff options
author | hsu <hsu@FreeBSD.org> | 2002-12-18 12:41:03 +0000 |
---|---|---|
committer | hsu <hsu@FreeBSD.org> | 2002-12-18 12:41:03 +0000 |
commit | 160081aef68b0dc49b79d3b7702b75671d9c06ff (patch) | |
tree | 34b893589d05bd801e4ea247ce3745ec78edc56d /sys | |
parent | 13107017098042a2164c72913b5390de7583af8e (diff) | |
download | FreeBSD-src-160081aef68b0dc49b79d3b7702b75671d9c06ff.zip FreeBSD-src-160081aef68b0dc49b79d3b7702b75671d9c06ff.tar.gz |
Switch to the conventional reference counting scheme.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_var.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h index bf9ee0c..3e3300e 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -391,23 +391,23 @@ struct ifmultiaddr { }; #ifdef _KERNEL -#define IFAFREE(ifa) \ - do { \ - IFA_LOCK(ifa); \ - if ((ifa)->ifa_refcnt == 0) { \ - IFA_DESTROY(ifa); \ - free(ifa, M_IFADDR); \ - } else { \ - --(ifa)->ifa_refcnt; \ - IFA_UNLOCK(ifa); \ - } \ +#define IFAFREE(ifa) \ + do { \ + IFA_LOCK(ifa); \ + KASSERT((ifa)->ifa_refcnt > 0, \ + ("ifa %p !(ifa_refcnt > 0)", ifa)); \ + if (--(ifa)->ifa_refcnt == 0) { \ + IFA_DESTROY(ifa); \ + free(ifa, M_IFADDR); \ + } else \ + IFA_UNLOCK(ifa); \ } while (0) -#define IFAREF(ifa) \ - do { \ - IFA_LOCK(ifa); \ - ++(ifa)->ifa_refcnt; \ - IFA_UNLOCK(ifa); \ +#define IFAREF(ifa) \ + do { \ + IFA_LOCK(ifa); \ + ++(ifa)->ifa_refcnt; \ + IFA_UNLOCK(ifa); \ } while (0) struct ifindex_entry { |