From owner-svn-src-all@FreeBSD.ORG Tue Dec 7 20:23:47 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 A58DB106564A; Tue, 7 Dec 2010 20:23:47 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A63A8FC0A; Tue, 7 Dec 2010 20:23:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB7KNl8n079065; Tue, 7 Dec 2010 20:23:47 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB7KNlPf079061; Tue, 7 Dec 2010 20:23:47 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201012072023.oB7KNlPf079061@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 7 Dec 2010 20:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216267 - in head: sbin/ifconfig sys/dev/usb 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: Tue, 07 Dec 2010 20:23:47 -0000 Author: weongyo Date: Tue Dec 7 20:23:47 2010 New Revision: 216267 URL: http://svn.freebsd.org/changeset/base/216267 Log: Introduces IFF_CANTCONFIG interface flag to point that the interface isn't configurable in a meaningful way. This is for ifconfig(8) or other tools not to change code whenever IFT_USB-like interfaces are registered at the interface list. Reviewed by: brooks No objections: gavin, jkim Modified: head/sbin/ifconfig/ifconfig.c head/sys/dev/usb/usb_pf.c head/sys/net/if.h Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Tue Dec 7 19:18:00 2010 (r216266) +++ head/sbin/ifconfig/ifconfig.c Tue Dec 7 20:23:47 2010 (r216267) @@ -295,8 +295,6 @@ main(int argc, char *argv[]) sdl = (const struct sockaddr_dl *) ifa->ifa_addr; else sdl = NULL; - if (sdl != NULL && sdl->sdl_type == IFT_USB) - continue; if (cp != NULL && strcmp(cp, ifa->ifa_name) == 0 && !namesonly) continue; iflen = strlcpy(name, ifa->ifa_name, sizeof(name)); @@ -307,6 +305,8 @@ main(int argc, char *argv[]) } cp = ifa->ifa_name; + if ((ifa->ifa_flags & IFF_CANTCONFIG) != 0) + continue; if (downonly && (ifa->ifa_flags & IFF_UP) != 0) continue; if (uponly && (ifa->ifa_flags & IFF_UP) == 0) Modified: head/sys/dev/usb/usb_pf.c ============================================================================== --- head/sys/dev/usb/usb_pf.c Tue Dec 7 19:18:00 2010 (r216266) +++ head/sys/dev/usb/usb_pf.c Tue Dec 7 20:23:47 2010 (r216267) @@ -64,6 +64,7 @@ usbpf_attach(struct usb_bus *ubus) ifp = ubus->ifp = if_alloc(IFT_USB); if_initname(ifp, "usbus", device_get_unit(ubus->bdev)); + ifp->if_flags = IFF_CANTCONFIG; if_attach(ifp); if_up(ifp); Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Tue Dec 7 19:18:00 2010 (r216266) +++ head/sys/net/if.h Tue Dec 7 20:23:47 2010 (r216267) @@ -145,7 +145,7 @@ struct if_data { #define IFF_LINK2 0x4000 /* per link layer defined bit */ #define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */ #define IFF_MULTICAST 0x8000 /* (i) supports multicast */ -/* 0x10000 */ +#define IFF_CANTCONFIG 0x10000 /* (i) unconfigurable using ioctl(2) */ #define IFF_PPROMISC 0x20000 /* (n) user-requested promisc mode */ #define IFF_MONITOR 0x40000 /* (n) user-requested monitor mode */ #define IFF_STATICARP 0x80000 /* (n) static ARP */