From owner-p4-projects@FreeBSD.ORG Tue Oct 30 04:48:39 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A12A216A46B; Tue, 30 Oct 2007 04:48:39 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E91FE16A420 for ; Tue, 30 Oct 2007 04:48:38 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D8F6913C4B3 for ; Tue, 30 Oct 2007 04:48:38 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l9U4mcs3015201 for ; Tue, 30 Oct 2007 04:48:38 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l9U4mcWJ015198 for perforce@freebsd.org; Tue, 30 Oct 2007 04:48:38 GMT (envelope-from kmacy@freebsd.org) Date: Tue, 30 Oct 2007 04:48:38 GMT Message-Id: <200710300448.l9U4mcWJ015198@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 128320 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2007 04:48:39 -0000 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++;