From owner-freebsd-net@FreeBSD.ORG Fri Nov 7 22:30:45 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF2861065670 for ; Fri, 7 Nov 2008 22:30:45 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.230]) by mx1.freebsd.org (Postfix) with ESMTP id B3F708FC12 for ; Fri, 7 Nov 2008 22:30:45 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so1331934rvf.43 for ; Fri, 07 Nov 2008 14:30:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:mime-version:content-type:content-transfer-encoding :content-disposition:x-google-sender-auth; bh=KGwZrE6WcUXNQDG5kbdkxNvYakN+mJR8g56oGC1AUiE=; b=TyqT13yPN2rONhmOOhfeH5jRjr3tmIHIFKkDUJx2vICsgclZQ8Q1u6Im+yj6bI1oCa eQl8pr0ze0byo+uf4AXcJXh41RxdQziLOveYdOekva8xJdDotoZj2KKGebvKwUEK62Yw tflzkXTpqthdLPVmPPRBwlidCmSQAPUXOpjFs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition:x-google-sender-auth; b=ubGkBFQjewdMZkao2p9dldc/sssv2DoDZg1A8Oa1u8/oA8OR2WVkOmLBxM0cV7pwb9 QhFp+wDkrGq+BjkrCWXyUYlBkGi+w9S4Cp7DD9OWmW7ui56lJ4RUbNbGooedaNhl0Jar p+6a9AUoUuaXErG6kgdBdyUDRSMGt2eVyY0KU= Received: by 10.141.2.19 with SMTP id e19mr2052936rvi.291.1226097045477; Fri, 07 Nov 2008 14:30:45 -0800 (PST) Received: by 10.140.157.8 with HTTP; Fri, 7 Nov 2008 14:30:45 -0800 (PST) Message-ID: <3c1674c90811071430s1f07ba6cp372609809ef7f591@mail.gmail.com> Date: Fri, 7 Nov 2008 22:30:45 +0000 From: "Kip Macy" Sender: mat.macy@gmail.com To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: 58a302c4e934f76f Subject: small radix_mpath patch X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 22:30:46 -0000 Calling arpresolve on an rtentry looked up by rtalloc_mpath_fib won't work because a gratuitous clone route is created without llinfo attached. As far as I can tell, routes should only ever be cloned for initial host route creation during a resolve to store arp information. Index: sys/net/radix_mpath.c =================================================================== --- sys/net/radix_mpath.c (revision 184756) +++ sys/net/radix_mpath.c (working copy) @@ -54,7 +54,7 @@ /* * give some jitter to hash, to avoid synchronization between routers */ -static u_int32_t hashjitter; +static uint32_t hashjitter; int rn_mpath_capable(struct radix_node_head *rnh) @@ -267,7 +267,7 @@ */ if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP)) return; /* XXX */ - ro->ro_rt = rtalloc1_fib(&ro->ro_dst, 1, 0UL, fibnum); + ro->ro_rt = rtalloc1_fib(&ro->ro_dst, 1, RTF_CLONING, fibnum); /* if the route does not exist or it is not multipath, don't care */ if (ro->ro_rt == NULL) @@ -299,7 +299,7 @@ return; } - rtfree(ro->ro_rt); + RTFREE_LOCKED(ro->ro_rt); ro->ro_rt = (struct rtentry *)rn; RT_LOCK(ro->ro_rt); RT_ADDREF(ro->ro_rt);