summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net/if.c10
-rw-r--r--sys/net/if.h10
-rw-r--r--sys/net/route.c10
-rw-r--r--sys/net/rtsock.c4
-rw-r--r--sys/netinet/if_ether.c4
-rw-r--r--sys/netinet/in.c8
-rw-r--r--sys/netinet6/in6.c14
-rw-r--r--sys/netinet6/in6_ifattach.c6
-rw-r--r--sys/netinet6/nd6.c4
-rw-r--r--sys/netinet6/nd6_nbr.c10
10 files changed, 36 insertions, 44 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index b0a3cb87c13..1accd8f93b0 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.248 2012/11/23 20:12:03 sthen Exp $ */
+/* $OpenBSD: if.c,v 1.249 2013/03/07 09:03:16 mpi Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -617,7 +617,7 @@ do { \
continue;
ifa->ifa_ifp = NULL;
- IFAFREE(ifa);
+ ifafree(ifa);
}
for (ifg = TAILQ_FIRST(&ifp->if_groups); ifg;
@@ -627,7 +627,7 @@ do { \
if_free_sadl(ifp);
ifnet_addrs[ifp->if_index]->ifa_ifp = NULL;
- IFAFREE(ifnet_addrs[ifp->if_index]);
+ ifafree(ifnet_addrs[ifp->if_index]);
ifnet_addrs[ifp->if_index] = NULL;
free(ifp->if_addrhooks, M_TEMP);
@@ -1040,7 +1040,7 @@ link_rtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
return;
if ((ifa = ifaof_ifpforaddr(dst, ifp)) != NULL) {
ifa->ifa_refcnt++;
- IFAFREE(rt->rt_ifa);
+ ifafree(rt->rt_ifa);
rt->rt_ifa = ifa;
if (ifa->ifa_rtrequest && ifa->ifa_rtrequest != link_rtrequest)
ifa->ifa_rtrequest(cmd, rt, info);
@@ -1523,7 +1523,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
(struct in_ifaddr *)ifa, ia_list);
ifa_del(ifp, ifa);
ifa->ifa_ifp = NULL;
- IFAFREE(ifa);
+ ifafree(ifa);
}
#endif
splx(s);
diff --git a/sys/net/if.h b/sys/net/if.h
index 0cf96f90ece..6672759b1ce 100644
--- a/sys/net/if.h
+++ b/sys/net/if.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.h,v 1.137 2012/11/23 20:12:03 sthen Exp $ */
+/* $OpenBSD: if.h,v 1.138 2013/03/07 09:03:16 mpi Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
@@ -707,14 +707,6 @@ struct if_laddrreq {
#include <net/if_arp.h>
#ifdef _KERNEL
-#define IFAFREE(ifa) \
-do { \
- if ((ifa)->ifa_refcnt <= 0) \
- ifafree(ifa); \
- else \
- (ifa)->ifa_refcnt--; \
-} while (/* CONSTCOND */0)
-
#ifdef ALTQ
#define IFQ_ENQUEUE(ifq, m, pattr, err) \
diff --git a/sys/net/route.c b/sys/net/route.c
index 9ec8a47a79d..2ab5ae2fdc1 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.141 2012/09/20 20:53:12 blambert Exp $ */
+/* $OpenBSD: route.c,v 1.142 2013/03/07 09:03:16 mpi Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -401,7 +401,7 @@ rtfree(struct rtentry *rt)
rt_timer_remove_all(rt);
ifa = rt->rt_ifa;
if (ifa)
- IFAFREE(ifa);
+ ifafree(ifa);
rtlabel_unref(rt->rt_labelid);
#ifdef MPLS
if (rt->rt_flags & RTF_MPLS)
@@ -926,7 +926,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio,
if ((*ret_nrt)->rt_ifa->ifa_rtrequest)
(*ret_nrt)->rt_ifa->ifa_rtrequest(
RTM_DELETE, *ret_nrt, NULL);
- IFAFREE((*ret_nrt)->rt_ifa);
+ ifafree((*ret_nrt)->rt_ifa);
(*ret_nrt)->rt_ifa = ifa;
(*ret_nrt)->rt_ifp = ifa->ifa_ifp;
ifa->ifa_refcnt++;
@@ -957,7 +957,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio,
RTFREE(crt);
}
if (rn == 0) {
- IFAFREE(ifa);
+ ifafree(ifa);
if ((rt->rt_flags & RTF_CLONED) != 0 && rt->rt_parent)
rtfree(rt->rt_parent);
if (rt->rt_gwroute)
@@ -1139,7 +1139,7 @@ rtinit(struct ifaddr *ifa, int cmd, int flags)
ifa, rt->rt_ifa);
if (rt->rt_ifa->ifa_rtrequest)
rt->rt_ifa->ifa_rtrequest(RTM_DELETE, rt, NULL);
- IFAFREE(rt->rt_ifa);
+ ifafree(rt->rt_ifa);
rt->rt_ifa = ifa;
rt->rt_ifp = ifa->ifa_ifp;
ifa->ifa_refcnt++;
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 13e8d5df754..e1d4a541b07 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.123 2012/09/20 20:53:13 blambert Exp $ */
+/* $OpenBSD: rtsock.c,v 1.124 2013/03/07 09:03:16 mpi Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -784,7 +784,7 @@ report:
if (oifa && oifa->ifa_rtrequest)
oifa->ifa_rtrequest(RTM_DELETE, rt,
&info);
- IFAFREE(rt->rt_ifa);
+ ifafree(rt->rt_ifa);
rt->rt_ifa = ifa;
ifa->ifa_refcnt++;
rt->rt_ifp = ifp;
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 4e669c77ec2..0070d16fd6a 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ether.c,v 1.96 2012/10/18 00:36:22 deraadt Exp $ */
+/* $OpenBSD: if_ether.c,v 1.97 2013/03/07 09:03:16 mpi Exp $ */
/* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */
/*
@@ -297,7 +297,7 @@ arp_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info)
*/
ifa = &ia->ia_ifa;
if (ifa != rt->rt_ifa) {
- IFAFREE(rt->rt_ifa);
+ ifafree(rt->rt_ifa);
ifa->ifa_refcnt++;
rt->rt_ifa = ifa;
}
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index 3ed28e92175..1ae937681b4 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in.c,v 1.72 2012/07/10 08:31:51 claudio Exp $ */
+/* $OpenBSD: in.c,v 1.73 2013/03/07 09:03:16 mpi Exp $ */
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
/*
@@ -426,7 +426,7 @@ cleanup:
}
/* remove backpointer, since ifp may die before ia */
ia->ia_ifp = NULL;
- IFAFREE((&ia->ia_ifa));
+ ifafree((&ia->ia_ifa));
if (!error)
dohooks(ifp->if_addrhooks, 0);
splx(s);
@@ -960,7 +960,7 @@ in_addmulti(struct in_addr *ap, struct ifnet *ifp)
if ((ifp->if_ioctl == NULL) ||
(*ifp->if_ioctl)(ifp, SIOCADDMULTI,(caddr_t)&ifr) != 0) {
LIST_REMOVE(inm, inm_list);
- IFAFREE(&inm->inm_ia->ia_ifa);
+ ifafree(&inm->inm_ia->ia_ifa);
free(inm, M_IPMADDR);
splx(s);
return (NULL);
@@ -995,7 +995,7 @@ in_delmulti(struct in_multi *inm)
*/
LIST_REMOVE(inm, inm_list);
ifp = inm->inm_ia->ia_ifp;
- IFAFREE(&inm->inm_ia->ia_ifa);
+ ifafree(&inm->inm_ia->ia_ifa);
if (ifp) {
/*
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index f1916ff4469..d1500ea6c8f 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.c,v 1.104 2013/03/04 14:42:25 bluhm Exp $ */
+/* $OpenBSD: in6.c,v 1.105 2013/03/07 09:03:16 mpi Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
@@ -194,7 +194,7 @@ in6_ifloop_request(int cmd, struct ifaddr *ifa)
* of the loopback address.
*/
if (cmd == RTM_ADD && nrt && ifa != nrt->rt_ifa) {
- IFAFREE(nrt->rt_ifa);
+ ifafree(nrt->rt_ifa);
ifa->ifa_refcnt++;
nrt->rt_ifa = ifa;
}
@@ -1276,7 +1276,7 @@ in6_unlink_ifa(struct in6_ifaddr *ia, struct ifnet *ifp)
* release another refcnt for the link from in6_ifaddr.
* Note that we should decrement the refcnt at least once for all *BSD.
*/
- IFAFREE(&oia->ia_ifa);
+ ifafree(&oia->ia_ifa);
splx(s);
}
@@ -1596,7 +1596,7 @@ in6_savemkludge(struct in6_ifaddr *oia)
for (in6m = LIST_FIRST(&oia->ia6_multiaddrs);
in6m != LIST_END(&oia->ia6_multiaddrs); in6m = next) {
next = LIST_NEXT(in6m, in6m_entry);
- IFAFREE(&in6m->in6m_ia->ia_ifa);
+ ifafree(&in6m->in6m_ia->ia_ifa);
ia->ia_ifa.ifa_refcnt++;
in6m->in6m_ia = ia;
LIST_INSERT_HEAD(&ia->ia6_multiaddrs, in6m, in6m_entry);
@@ -1614,7 +1614,7 @@ in6_savemkludge(struct in6_ifaddr *oia)
for (in6m = LIST_FIRST(&oia->ia6_multiaddrs);
in6m != LIST_END(&oia->ia6_multiaddrs); in6m = next) {
next = LIST_NEXT(in6m, in6m_entry);
- IFAFREE(&in6m->in6m_ia->ia_ifa); /* release reference */
+ ifafree(&in6m->in6m_ia->ia_ifa); /* release reference */
in6m->in6m_ia = NULL;
LIST_INSERT_HEAD(&mk->mk_head, in6m, in6m_entry);
}
@@ -1762,7 +1762,7 @@ in6_addmulti(struct in6_addr *maddr6, struct ifnet *ifp, int *errorp)
if (*errorp) {
LIST_REMOVE(in6m, in6m_entry);
free(in6m, M_IPMADDR);
- IFAFREE(&ia->ia_ifa);
+ ifafree(&ia->ia_ifa);
splx(s);
return (NULL);
}
@@ -1797,7 +1797,7 @@ in6_delmulti(struct in6_multi *in6m)
*/
LIST_REMOVE(in6m, in6m_entry);
if (in6m->in6m_ia) {
- IFAFREE(&in6m->in6m_ia->ia_ifa); /* release reference */
+ ifafree(&in6m->in6m_ia->ia_ifa); /* release reference */
}
/*
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c
index 2759bc34cd4..da97be5c5ca 100644
--- a/sys/netinet6/in6_ifattach.c
+++ b/sys/netinet6/in6_ifattach.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_ifattach.c,v 1.57 2013/03/04 14:42:25 bluhm Exp $ */
+/* $OpenBSD: in6_ifattach.c,v 1.58 2013/03/07 09:03:16 mpi Exp $ */
/* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */
/*
@@ -715,7 +715,7 @@ in6_ifdetach(struct ifnet *ifp)
/* remove from the linked list */
ifa_del(ifp, &ia->ia_ifa);
- IFAFREE(&ia->ia_ifa);
+ ifafree(&ia->ia_ifa);
/* also remove from the IPv6 address chain(itojun&jinmei) */
oia = ia;
@@ -733,7 +733,7 @@ in6_ifdetach(struct ifnet *ifp)
}
}
- IFAFREE(&oia->ia_ifa);
+ ifafree(&oia->ia_ifa);
}
/* cleanup multicast address kludge table, if there is any */
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index dee5c7a1c87..9456aa7f30f 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.c,v 1.93 2013/01/15 10:15:19 bluhm Exp $ */
+/* $OpenBSD: nd6.c,v 1.94 2013/03/07 09:03:16 mpi Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
@@ -1197,7 +1197,7 @@ nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info)
* of the loopback address.
*/
if (ifa != rt->rt_ifa) {
- IFAFREE(rt->rt_ifa);
+ ifafree(rt->rt_ifa);
ifa->ifa_refcnt++;
rt->rt_ifa = ifa;
}
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index d177cb0becc..16b771588bb 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_nbr.c,v 1.65 2013/03/04 14:42:25 bluhm Exp $ */
+/* $OpenBSD: nd6_nbr.c,v 1.66 2013/03/07 09:03:16 mpi Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/*
@@ -1207,7 +1207,7 @@ nd6_dad_stop(struct ifaddr *ifa)
TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list);
free(dp, M_IP6NDP);
dp = NULL;
- IFAFREE(ifa);
+ ifafree(ifa);
ip6_dad_pending--;
}
@@ -1253,7 +1253,7 @@ nd6_dad_timer(struct ifaddr *ifa)
TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list);
free(dp, M_IP6NDP);
dp = NULL;
- IFAFREE(ifa);
+ ifafree(ifa);
ip6_dad_pending--;
goto done;
}
@@ -1307,7 +1307,7 @@ nd6_dad_timer(struct ifaddr *ifa)
TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list);
free(dp, M_IP6NDP);
dp = NULL;
- IFAFREE(ifa);
+ ifafree(ifa);
ip6_dad_pending--;
}
}
@@ -1347,7 +1347,7 @@ nd6_dad_duplicated(struct ifaddr *ifa)
TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list);
free(dp, M_IP6NDP);
dp = NULL;
- IFAFREE(ifa);
+ ifafree(ifa);
ip6_dad_pending--;
}