--- src/sys/netinet/ip_output.c 2008/09/11 11:23:29 1.59 +++ src/sys/netinet/ip_output.c 2008/09/12 11:37:41 1.60 @@ -118,6 +118,8 @@ static int ip_setmoptions int ip_optcopy(struct ip *, struct ip *); +extern int route_assert_owner_access; +extern void db_print_backtrace(void); extern struct protosw inetsw[]; @@ -238,6 +240,19 @@ ip_output(struct mbuf *m0, struct mbuf * ro = &iproute; bzero(ro, sizeof *ro); } else if (ro->ro_rt != NULL && ro->ro_rt->rt_cpuid != mycpuid) { + if (flags & IP_DEBUGROUTE) { + if (route_assert_owner_access) { + panic("ip_output: " + "rt rt_cpuid %d accessed on cpu %d\n", + ro->ro_rt->rt_cpuid, mycpuid); + } else { + kprintf("ip_output: " + "rt rt_cpuid %d accessed on cpu %d\n", + ro->ro_rt->rt_cpuid, mycpuid); + db_print_backtrace(); + } + } + /* * XXX * If the cached rtentry's owner CPU is not the current CPU,