PERFORCE change 128320 for review

Kip Macy kmacy at FreeBSD.org
Mon Oct 29 21:48:39 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=128320

Change 128320 by kmacy at 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++;


More information about the p4-projects mailing list