From owner-freebsd-net@FreeBSD.ORG Thu May 17 02:40:07 2012 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 B08AC1065670 for ; Thu, 17 May 2012 02:40:07 +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 866B58FC12 for ; Thu, 17 May 2012 02:40:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4H2e7SK002572 for ; Thu, 17 May 2012 02:40:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4H2e7Ml002571; Thu, 17 May 2012 02:40:07 GMT (envelope-from gnats) Date: Thu, 17 May 2012 02:40:07 GMT Message-Id: <201205170240.q4H2e7Ml002571@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: "Devon H. O'Dell" Cc: Subject: Re: kern/110284: [if_ethersubr] Invalid Assumption in SIOCSIFADDR in ether_ioctl() X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Devon H. O'Dell" List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 02:40:07 -0000 The following reply was made to PR kern/110284; it has been noted by GNATS. From: "Devon H. O'Dell" To: bug-followup@FreeBSD.org, freebsd-net@freebsd.org, gavin@freebsd.org Cc: Subject: Re: kern/110284: [if_ethersubr] Invalid Assumption in SIOCSIFADDR in ether_ioctl() Date: Wed, 16 May 2012 22:33:31 -0400 Hi Gavin, freebsd-net, I submitted this PR when I worked at Coyote Point. I'm no longer there, but I do remember this issue well. The discussion around this patch happened on IRC and not the PR, which is unfortunate. If I recall correctly, rwatson's stance was that the real fix was to fix the heinous layer between ioctl and device. As far as I'm aware, this is still an issue with current drivers, and this patch still solves the issue. CP ran with it successfully for years. (And unsuccessfully for a time before it was implemented :)). The patch is basically (forgive formatting): --- if_ethersubr.c 2011-09-22 20:51:37.000000000 -0400 +++ /home/dho/if_ethersubr.c 2012-05-16 22:27:17.000000000 -0400 @@ -1146,7 +1146,9 @@ switch (ifa->ifa_addr->sa_family) { #ifdef INET case AF_INET: - ifp->if_init(ifp->if_softc); /* before arpwhohas */ + if (ifp->if_flags & IFF_RUNNING == 0) { + ifp->if_init(ifp->if_softc); /* before arpwhohas */ + } arp_ifinit(ifp, ifa); break; #endif