From owner-freebsd-net@FreeBSD.ORG Fri Sep 17 12:50:03 2010 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E17E9106564A for ; Fri, 17 Sep 2010 12:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CECEB8FC0A for ; Fri, 17 Sep 2010 12:50:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o8HCo3YL047125 for ; Fri, 17 Sep 2010 12:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o8HCo3h0047124; Fri, 17 Sep 2010 12:50:03 GMT (envelope-from gnats) Date: Fri, 17 Sep 2010 12:50:03 GMT Message-Id: <201009171250.o8HCo3h0047124@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: Pete French Cc: Subject: Re: kern/149804: [icmp] [panic] ICMP redirect on causes "panic: rtqkill route really not free" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Pete French List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 12:50:04 -0000 The following reply was made to PR kern/149804; it has been noted by GNATS. From: Pete French To: bug-followup@FreeBSD.org, petefrench@ticketswitch.com Cc: Subject: Re: kern/149804: [icmp] [panic] ICMP redirect on causes "panic: rtqkill route really not free" Date: Fri, 17 Sep 2010 13:44:14 +0100 Here is the patch I am currently using which makes the problem go away. = As states above, this was sent to me by Xin Li - it's not my own work! Index: sys/netinet/in_rmx.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/netinet/in_rmx.c (revision 211232) +++ sys/netinet/in_rmx.c (working copy) @@ -121,12 +121,13 @@ in_matroute(void *v_arg, struct radix_node_head *h struct radix_node *rn =3D rn_match(v_arg, head); struct rtentry *rt =3D (struct rtentry *)rn; =20 - /*XXX locking? */ - if (rt && rt->rt_refcnt =3D=3D 0) { /* this is first = reference */ + if (rt) { + RT_LOCK(rt); if (rt->rt_flags & RTPRF_OURS) { rt->rt_flags &=3D ~RTPRF_OURS; rt->rt_rmx.rmx_expire =3D 0; } + RT_UNLOCK(rt); } return rn; }