summaryrefslogtreecommitdiffstats
path: root/sys/net/route.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1995-07-10 15:22:37 +0000
committerwollman <wollman@FreeBSD.org>1995-07-10 15:22:37 +0000
commitd3e9d64ff6195ae0b8325862d35eb96d66c16b05 (patch)
tree4fcbb1f484909ce6b6670d93c44f7a86ed8b9823 /sys/net/route.c
parentd088fb31faee2d2de7b1020be7d1f903f41c8765 (diff)
downloadFreeBSD-src-d3e9d64ff6195ae0b8325862d35eb96d66c16b05.zip
FreeBSD-src-d3e9d64ff6195ae0b8325862d35eb96d66c16b05.tar.gz
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.
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 ca705b5..1e76436 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) {
OpenPOWER on IntegriCloud