aboutsummaryrefslogtreecommitdiff
path: root/sys/net/route.c
diff options
context:
space:
mode:
authorGarrett Wollman <wollman@FreeBSD.org>1995-07-10 15:22:37 +0000
committerGarrett Wollman <wollman@FreeBSD.org>1995-07-10 15:22:37 +0000
commit8e718bb4af7a00dda43346f080c8c02c838fed06 (patch)
tree4fcbb1f484909ce6b6670d93c44f7a86ed8b9823 /sys/net/route.c
parent6306c897b5f9e9959fc616c125c39daebe590d99 (diff)
downloadsrc-8e718bb4af7a00dda43346f080c8c02c838fed06.tar.gz
src-8e718bb4af7a00dda43346f080c8c02c838fed06.zip
When adding a route, set rt_ifa and rt_ifp a little earlier so that
the protocol-specific add routine can examine it if desired.
Notes
Notes: svn path=/head/; revision=9469
Diffstat (limited to 'sys/net/route.c')
-rw-r--r--sys/net/route.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index ca705b568fdd..1e76436192cd 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)route.c 8.2 (Berkeley) 11/15/93
- * $Id: route.c,v 1.22 1995/04/25 19:12:07 wollman Exp $
+ * $Id: route.c,v 1.23 1995/05/30 08:08:24 rgrimes Exp $
*/
#include <sys/param.h>
@@ -449,18 +449,27 @@ rtrequest(req, dst, gateway, netmask, flags, ret_nrt)
rt_maskedcopy(dst, ndst, netmask);
} else
Bcopy(dst, ndst, dst->sa_len);
+
+ /*
+ * This moved from below so that rnh->rnh_addaddr() can
+ * examine the ifa and ifp if it so desires.
+ */
+ ifa->ifa_refcnt++;
+ rt->rt_ifa = ifa;
+ rt->rt_ifp = ifa->ifa_ifp;
+
rn = rnh->rnh_addaddr((caddr_t)ndst, (caddr_t)netmask,
rnh, rt->rt_nodes);
if (rn == 0) {
if (rt->rt_gwroute)
rtfree(rt->rt_gwroute);
+ if (rt->rt_ifa) {
+ IFAFREE(rt->rt_ifa);
+ }
Free(rt_key(rt));
Free(rt);
senderr(EEXIST);
}
- ifa->ifa_refcnt++;
- rt->rt_ifa = ifa;
- rt->rt_ifp = ifa->ifa_ifp;
rt->rt_parent = 0;
if (req == RTM_RESOLVE) {