From owner-svn-src-all@FreeBSD.ORG Fri Mar 12 08:28:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F29F106566B; Fri, 12 Mar 2010 08:28:05 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-fx0-f209.google.com (mail-fx0-f209.google.com [209.85.220.209]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9C78FC25; Fri, 12 Mar 2010 08:28:03 +0000 (UTC) Received: by fxm1 with SMTP id 1so229231fxm.13 for ; Fri, 12 Mar 2010 00:28:03 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.103.135.25 with SMTP id m25mr1643944mun.32.1268382483101; Fri, 12 Mar 2010 00:28:03 -0800 (PST) In-Reply-To: <9ace436c1003120011v3c627aadka2e57615ae01fe6f@mail.gmail.com> References: <201003111756.o2BHukJu042449@svn.freebsd.org> <9ace436c1003111530s3bd0de9cq451671909fb6aa64@mail.gmail.com> <5ADB6F0D-11F1-4F9F-87A0-64F57063981E@freebsd.org> <9ace436c1003112352l3b2505ceq63d9c78954520497@mail.gmail.com> <9ace436c1003120011v3c627aadka2e57615ae01fe6f@mail.gmail.com> From: Juli Mallett Date: Fri, 12 Mar 2010 00:27:43 -0800 X-Google-Sender-Auth: 98194c00f6a6ed34 Message-ID: To: Qing Li Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Robert N. M. Watson" Subject: Re: svn commit: r205024 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2010 08:28:05 -0000 On Fri, Mar 12, 2010 at 00:11, Qing Li wrote: > I like Julian's suggestion because it is simple and very low risk. > And there isn't a need to check for interface type any more. > Here is why: For actual link state, you can already see whether a driver is in UNKNOWN state, like: %%% /* * Values for if_link_state. */ #define LINK_STATE_UNKNOWN 0 /* link invalid/unknown */ #define LINK_STATE_DOWN 1 /* link is down */ #define LINK_STATE_UP 2 /* link is up */ %%% Therefore you should be able to easily add assertions and debugging printfs for interfaces that don't event support *setting* link state -- which is the real problem more than changing link state, since a driver probably won't report link as down if it has no intention of changing it. It doesn't help that there are two things wrt link state floating around -- one in the form of LINK_STATE (the one that matters here) and the other in ifmedia stuff. I think that's confusing this discussion gratuitously. Juli.