Date: Tue, 30 Oct 2007 04:48:38 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 128320 for review Message-ID: <200710300448.l9U4mcWJ015198@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=128320 Change 128320 by kmacy@kmacy:storage:toestack on 2007/10/30 04:48:29 pass rtentry for gateway to eventhandler when redirect is pointed at a gateway Affected files ... .. //depot/projects/toestack/sys/net/route.c#7 edit Differences ... ==== //depot/projects/toestack/sys/net/route.c#7 (text+ko) ==== @@ -487,7 +487,7 @@ */ create: rt0 = rt; - + flags |= RTF_GATEWAY | RTF_DYNAMIC; bzero((caddr_t)&info, sizeof(info)); info.rti_info[RTAX_DST] = dst; @@ -508,6 +508,8 @@ stat = &rtstat.rts_dynamic; } else { + struct rtentry *gwrt; + /* * Smash the current notion of the gateway to * this destination. Should check about netmask!!! @@ -519,13 +521,15 @@ * add the key and gateway (in one malloc'd chunk). */ rt_setgate(rt, rt_key(rt), gateway); - EVENTHANDLER_INVOKE(route_event, RTEVENT_REDIRECT_UPDATE, rt, gateway); + gwrt = rtalloc1(gateway, 1, 0); + EVENTHANDLER_INVOKE(route_event, RTEVENT_REDIRECT_UPDATE, rt, gwrt); + RTFREE_LOCKED(gwrt); } } else error = EHOSTUNREACH; done: if (rt) - rtfree(rt); + RTFREE_LOCKED(rt); out: if (error) rtstat.rts_badredirect++;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710300448.l9U4mcWJ015198>