diff options
| author | Jeffrey Hsu <hsu@FreeBSD.org> | 2002-12-18 12:41:03 +0000 |
|---|---|---|
| committer | Jeffrey Hsu <hsu@FreeBSD.org> | 2002-12-18 12:41:03 +0000 |
| commit | 68eec1f80cd88e91cb92d06ce4ae75fc5077ab13 (patch) | |
| tree | 34b893589d05bd801e4ea247ce3745ec78edc56d | |
| parent | a0ce78ec1de74f98b44c249f3b65974eec0fd49a (diff) | |
Notes
| -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 bf9ee0c16d91..3e3300ee7454 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 { |
